Skip to content

Commit

Permalink
Merge branch 'thumbnail-preview' of https://github.com/Nazar78/MRisco…
Browse files Browse the repository at this point in the history
…CProUI into thumbnail-preview
  • Loading branch information
Nazar78 committed Oct 30, 2023
2 parents 7989e21 + 92696d8 commit eea7a70
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
#include "lockscreen.h"
#endif

#if HAS_SOUND
#include "../../../libs/buzzer.h"
#endif

//#define DEBUG_OUT ENABLED(DEBUG_DWIN)
#include "../../../core/debug_out.h"

Expand Down Expand Up @@ -760,7 +756,7 @@ void _draw_feedrate() {
DWINUI::Draw_String(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 116 + 4 * STAT_CHR_W + 2, 384, F(" %"));
}
else {
_value = CEIL(MMS_SCALED(feedrate_mm_s));
_value = CEIL(feedrate_mm_s * feedrate_percentage / 100);
DWIN_Draw_Box(1, HMI_data.Background_Color, 116 + 4 * STAT_CHR_W + 2, 384, 30, 20);
}
DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 116 + 2 * STAT_CHR_W, 384, _value);
Expand Down Expand Up @@ -794,8 +790,8 @@ void _draw_xyz_position(const bool force) {
}

void update_variable() {
TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH - 6 * DWINUI::fontWidth(), 6, checkkey);)
TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH - 3 * DWINUI::fontWidth(), 6, last_checkkey);)
TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH-6*DWINUI::fontWidth(), 6, checkkey);)
TERN_(DEBUG_DWIN, DWINUI::Draw_Int(Color_Yellow, Color_Bg_Black, 2, DWIN_WIDTH-3*DWINUI::fontWidth(), 6, last_checkkey);)

_draw_xyz_position(false);

Expand Down Expand Up @@ -1252,6 +1248,8 @@ void HMI_Printing() {
DWIN_UpdateLCD();
}

#include "../../../libs/buzzer.h"

void Draw_Main_Area() {
switch (checkkey) {
case MainMenu: Draw_Main_Menu(); break;
Expand Down Expand Up @@ -1574,7 +1572,7 @@ void DWIN_HomingStart() {
HMI_flag.home_flag = true;
HMI_SaveProcessID(Homing);
Title.ShowCaption(GET_TEXT_F(MSG_HOMING));
DWIN_Show_Popup(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT));
DWIN_Show_Popup(ICON_Printer_0, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT));
}

void DWIN_HomingDone() {
Expand Down Expand Up @@ -1900,7 +1898,7 @@ void DWIN_Print_Aborted() {
DWIN_Print_Finished();
}

#if (ALT_COLOR_MENU == 1) // 1 = Alternate Aquila
#if (ALT_COLOR_MENU == 1)
void DWIN_SetColorDefaults() {
HMI_data.Background_Color = Def_Background_Color;
HMI_data.Cursor_Color = Def_Cursor_Color;
Expand All @@ -1922,7 +1920,7 @@ void DWIN_Print_Aborted() {
HMI_data.Coordinate_Color = Def_Coordinate_Color;
HMI_data.Bottom_Color = Def_Bottom_Color;
}
#elif (ALT_COLOR_MENU == 2) // 2 = Ender3V2 Default
#elif (ALT_COLOR_MENU == 2)
void DWIN_SetColorDefaults() {
#undef Def_Background_Color
#undef Def_Text_Color
Expand Down Expand Up @@ -1950,7 +1948,7 @@ void DWIN_Print_Aborted() {
HMI_data.Coordinate_Color = Color_White;
HMI_data.Bottom_Color = RGB( 0, 23, 16);
}
#else // 0 = Voxelab Default
#else
void DWIN_SetColorDefaults() {
HMI_data.Background_Color = Def_Background_Color;
HMI_data.Cursor_Color = Def_Text_Color;
Expand Down Expand Up @@ -2155,7 +2153,7 @@ void MarlinUI::refresh() { /* Nothing to see here */ }
#endif

void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) {
DWIN_Draw_Popup(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error);
DWIN_Draw_Popup(ICON_Printer_0, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error);
DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 270, GET_TEXT_F(MSG_TURN_OFF));
DWIN_UpdateLCD();
}
Expand Down Expand Up @@ -2597,8 +2595,7 @@ void ApplyMove() {
#endif

#if LCD_BACKLIGHT_TIMEOUT_MINS
void ApplyTimer() { ui.backlight_timeout_minutes = MenuData.Value; }
void SetTimer() { SetIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max, ui.backlight_timeout_minutes, ApplyTimer); }
void SetTimer() { SetPIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max); }
#endif

#if PROUI_EX && ENABLED(NOZZLE_PARK_FEATURE)
Expand Down Expand Up @@ -3093,7 +3090,7 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) {

#if HAS_BED_PROBE && ENABLED(TRAMWIZ_MENU_ITEM)
// Trammingwizard Popup
void PopUp_StartTramwiz() { DWIN_Popup_ConfirmCancel(TERN(TJC_DISPLAY, ICON_BLTouch, ICON_Printer_0), F("Start Tramming Wizard?")); }
void PopUp_StartTramwiz() { DWIN_Popup_ConfirmCancel(ICON_Printer_0, F("Start Tramming Wizard?")); }
void onClick_StartTramwiz() {
if (HMI_flag.select_flag) {
if (HMI_data.FullManualTramming) {
Expand Down Expand Up @@ -3479,7 +3476,7 @@ void Draw_Tune_Menu() {
EDIT_ITEM(ICON_MaxAccelerated, MSG_ADVANCE_K, onDrawPFloat3Menu, SetLA_K, &planner.extruder_advance_K[0]);
#endif
#if LCD_BACKLIGHT_TIMEOUT_MINS
EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes);
EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes);
#endif
#if HAS_LCD_BRIGHTNESS
EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness);
Expand Down Expand Up @@ -4494,7 +4491,7 @@ void Draw_AdvancedSettings_Menu() {
EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness);
#endif
#if LCD_BACKLIGHT_TIMEOUT_MINS
EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes);
EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes);
#endif
#if BED_SCREW_INSET
EDIT_ITEM_F(ICON_ProbeMargin, "Bed Screw Inset", onDrawPFloatMenu, SetRetractSpeed, &ui.screw_pos);
Expand Down Expand Up @@ -4549,7 +4546,7 @@ void Draw_Advanced_Menu() { // From Control_Menu (Control) || Default-NP Advance
EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness);
#endif
#if LCD_BACKLIGHT_TIMEOUT_MINS
EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPInt8Menu, SetTimer, &ui.backlight_timeout_minutes);
EDIT_ITEM(ICON_Box, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, SetTimer, &ui.backlight_timeout_minutes);
#endif
#if BED_SCREW_INSET
EDIT_ITEM_F(ICON_ProbeMargin, "Bed Screw Inset", onDrawPFloatMenu, SetRetractSpeed, &ui.screw_pos);
Expand Down

0 comments on commit eea7a70

Please sign in to comment.