From f5a7ec02ff2012fbd013937c2e39091e605eecb5 Mon Sep 17 00:00:00 2001 From: kisslorand <50251547+kisslorand@users.noreply.github.com> Date: Tue, 26 Sep 2023 05:07:34 +0300 Subject: [PATCH] Move menu cosmetics (#2834) --- TFT/src/User/API/menu.c | 5 +++++ TFT/src/User/API/menu.h | 1 + TFT/src/User/Menu/Move.c | 26 ++++++++++++++------------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/TFT/src/User/API/menu.c b/TFT/src/User/API/menu.c index ecfdff1a9e..acfdadf89b 100644 --- a/TFT/src/User/API/menu.c +++ b/TFT/src/User/API/menu.c @@ -667,6 +667,11 @@ void setMenu(MENU_TYPE menu_type, LABEL * title, uint16_t rectCount, const GUI_R #endif } +SYS_STATUS getReminderStatus(void) +{ + return reminder.status; +} + void drawReminderMsg(void) { uint16_t msgRectOffset = (LCD_WIDTH - GUI_StrPixelWidth(reminder.inf)) / 2 - BYTE_WIDTH; diff --git a/TFT/src/User/API/menu.h b/TFT/src/User/API/menu.h index d27df4c1f7..cb344b78ca 100644 --- a/TFT/src/User/API/menu.h +++ b/TFT/src/User/API/menu.h @@ -172,6 +172,7 @@ extern const GUI_RECT rect_of_titleBar[1]; void setMenuType(MENU_TYPE type); MENU_TYPE getMenuType(void); +SYS_STATUS getReminderStatus(void); void setReminderMsg(int16_t inf, SYS_STATUS status); void notificationDot(void); diff --git a/TFT/src/User/Menu/Move.c b/TFT/src/User/Menu/Move.c index ca23c3757e..a69299abb4 100644 --- a/TFT/src/User/Menu/Move.c +++ b/TFT/src/User/Menu/Move.c @@ -31,18 +31,20 @@ void storeMoveCmd(const AXIS xyz, const float amount) void drawXYZ(void) { + if (getReminderStatus() != SYS_STATUS_IDLE || toastRunning()) return; + char tempstr[30]; GUI_SetColor(infoSettings.status_color); sprintf(tempstr, "X:%.2f ", coordinateGetAxisActual(X_AXIS)); - GUI_DispString(START_X + (OFFSET + 0) * SPACE_X + (OFFSET + 0) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr); + GUI_DispString(START_X + (OFFSET + 0) * SPACE_X + (OFFSET + 0) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr); sprintf(tempstr, "Y:%.2f ", coordinateGetAxisActual(Y_AXIS)); - GUI_DispString(START_X + (OFFSET + 1) * SPACE_X + (OFFSET + 1) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr); + GUI_DispString(START_X + (OFFSET + 1) * SPACE_X + (OFFSET + 1) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr); sprintf(tempstr, "Z:%.2f ", coordinateGetAxisActual(Z_AXIS)); - GUI_DispString(START_X + (OFFSET + 2) * SPACE_X + (OFFSET + 2) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr); + GUI_DispString(START_X + (OFFSET + 2) * SPACE_X + (OFFSET + 2) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr); GUI_SetColor(infoSettings.font_color); } @@ -65,20 +67,20 @@ void menuMove(void) { #ifdef ALTERNATIVE_MOVE_MENU {ICON_Z_DEC, LABEL_Z_DEC}, - {ICON_Y_INC, LABEL_Y_INC}, + {ICON_Y_INC, LABEL_Y_DEC}, {ICON_Z_INC, LABEL_Z_INC}, {ICON_01_MM, LABEL_01_MM}, {ICON_X_DEC, LABEL_X_DEC}, - {ICON_Y_DEC, LABEL_Y_DEC}, + {ICON_Y_DEC, LABEL_Y_INC}, {ICON_X_INC, LABEL_X_INC}, {ICON_BACK, LABEL_BACK}, #else {ICON_X_INC, LABEL_X_INC}, - {ICON_Y_INC, LABEL_Y_INC}, + {ICON_Y_DEC, LABEL_Y_INC}, {ICON_Z_INC, LABEL_Z_INC}, {ICON_01_MM, LABEL_01_MM}, {ICON_X_DEC, LABEL_X_DEC}, - {ICON_Y_DEC, LABEL_Y_DEC}, + {ICON_Y_INC, LABEL_Y_DEC}, {ICON_Z_DEC, LABEL_Z_DEC}, {ICON_BACK, LABEL_BACK}, #endif @@ -96,12 +98,12 @@ void menuMove(void) uint8_t table[TOTAL_AXIS][2] = #ifdef ALTERNATIVE_MOVE_MENU /*-------*-------*-------*---------* - | Z-(0) | Y+(1) | Z+(2) | unit(3) | + | Z-(0) | Y-(1) | Z+(2) | unit(3) | *-------*-------*-------*---------* - | X-(4) | Y-(5) | X+(6) | back(7) | + | X-(4) | Y+(5) | X+(6) | back(7) | *-------*-------*-------*---------* |X+ X- |Y+ Y- |Z+ Z- */ - {{6, 4}, {1, 5}, {2, 0}} + {{6, 4}, {5, 1}, {2, 0}} #else /*-------*-------*-------*---------* | X+(0) | Y+(1) | Z+(2) | unit(3) | @@ -141,7 +143,7 @@ void menuMove(void) { #ifdef ALTERNATIVE_MOVE_MENU case KEY_ICON_0: storeMoveCmd(Z_AXIS, -amount); break; // Z move down if no invert - case KEY_ICON_1: storeMoveCmd(Y_AXIS, amount); break; // Y move increase if no invert + case KEY_ICON_1: storeMoveCmd(Y_AXIS, -amount); break; // Y move decrease if no invert case KEY_ICON_2: storeMoveCmd(Z_AXIS, amount); break; // Z move up if no invert case KEY_ICON_3: @@ -154,7 +156,7 @@ void menuMove(void) break; case KEY_ICON_4: storeMoveCmd(X_AXIS, -amount); break; // X move decrease if no invert - case KEY_ICON_5: storeMoveCmd(Y_AXIS, -amount); break; // Y move decrease if no invert + case KEY_ICON_5: storeMoveCmd(Y_AXIS, amount); break; // Y move increase if no invert case KEY_ICON_6: storeMoveCmd(X_AXIS, amount); break; // X move increase if no invert case KEY_ICON_7: CLOSE_MENU(); break;