diff --git a/TFT/src/User/API/UI/list_item.c b/TFT/src/User/API/UI/list_item.c index 1c7b0d0019..d8e50499d5 100644 --- a/TFT/src/User/API/UI/list_item.c +++ b/TFT/src/User/API/UI/list_item.c @@ -426,8 +426,8 @@ void DrawListItemPress(const GUI_RECT * rect, bool pressed){ GUI_DrawPrect(rect); GUI_SetColor(LISTBTN_BKCOLOR); - GUI_DrawLine(rect->x0, rect->y0 , rect->x1, rect->y0 ); - GUI_DrawLine(rect->x0, rect->y1 , rect->x1, rect->y1 ); + GUI_DrawLine(rect->x0, rect->y0-1 , rect->x1-1, rect->y0-1 ); + GUI_DrawLine(rect->x0, rect->y1-1 , rect->x1-1, rect->y1-1 ); } GUI_RestoreColorDefault(); } @@ -482,6 +482,7 @@ void ListItem_Display(const GUI_RECT* rect, uint8_t positon, const LISTITEM * cu GUI_DispLenString(pos.x , pos.y, textSelect(curitem->titlelabel.index),textarea_width); pos = getTextStartPoint(rect->x0, rect->y0, rect->x1,rect->y1,RIGHT_CENTER,GET_ICONCHAR[ICONCHAR_TOGGLE_BODY]); + GUI_ClearRect(rect->x1-wy,rect->y0,rect->x1,rect->y1); ListItem_DisplayToggle(pos.x, pos.y, curitem->icon); DrawListItemPress(rect,pressed); break; @@ -509,7 +510,7 @@ void ListItem_Display(const GUI_RECT* rect, uint8_t positon, const LISTITEM * cu case LIST_CUSTOMVALUE: if(curitem->icon != ICONCHAR_BLANK) { ListDrawIcon(rect,LEFT_CENTER,curitem->icon,BLACK); - pos.x += (BYTE_HEIGHT + 1); + pos.x += (BYTE_HEIGHT + 3); } GUI_DispString(pos.x, pos.y, textSelect(curitem->titlelabel.index)); @@ -543,7 +544,7 @@ void ListItem_DisplayToggle(uint16_t sx, uint16_t sy, uint8_t iconchar_state) GUI_DispString(sx, sy, (uint8_t*)GET_ICONCHAR[ICONCHAR_TOGGLE_BODY]); GUI_SetTextMode(GUI_TEXTMODE_TRANS); - GUI_SetColor(ICON_COLOR[iconchar_state]); + GUI_SetColor(ICON_COLOR[iconchar_state]); if (iconchar_state == ICONCHAR_TOGGLE_OFF) { GUI_DispString(sx, sy, IconCharSelect(ICONCHAR_TOGGLE_SWITCH)); @@ -560,7 +561,7 @@ void ListItem_DisplayToggle(uint16_t sx, uint16_t sy, uint8_t iconchar_state) void ListItem_DisplayCustomValue(const GUI_RECT* rect,uint8_t * value) { - const GUI_RECT rectVal = {rect->x1-BYTE_WIDTH*8 -2,rect->y0+(LISTITEM_HEIGHT-BYTE_HEIGHT)/2,rect->x1-2,rect->y1-(LISTITEM_HEIGHT-BYTE_HEIGHT)/2}; + const GUI_RECT rectVal = {rect->x1-BYTE_WIDTH*8 -1,rect->y0+(LISTITEM_HEIGHT-BYTE_HEIGHT)/2,rect->x1-1,rect->y1-(LISTITEM_HEIGHT-BYTE_HEIGHT)/2}; //GUI_POINT pos = getTextStartPoint(rect_of_keyListView.x0, rect->y0, rect->x1,rect->y1, pos, iconchar); GUI_ClearPrect(&rectVal); diff --git a/TFT/src/User/Menu/FeatureSettings.c b/TFT/src/User/Menu/FeatureSettings.c index 8a4b01c062..0057f7e81a 100644 --- a/TFT/src/User/Menu/FeatureSettings.c +++ b/TFT/src/User/Menu/FeatureSettings.c @@ -255,7 +255,7 @@ // void updateFeatureSettings(uint8_t key_val) { - uint8_t item_index = fe_cur_page*FE_PAGE_COUNT+ key_val; + uint8_t item_index = fe_cur_page*LISTITEM_PER_PAGE+ key_val; switch (item_index) { case SKEY_HIDEACK: @@ -273,8 +273,8 @@ break; case SKEY_INVERT_Z: - infoSettings.invert_yaxis = (infoSettings.invert_yaxis + 1) % 2; - settingPage[item_index].icon = toggleitem[infoSettings.invert_yaxis]; + infoSettings.invert_zaxis = (infoSettings.invert_zaxis + 1) % 2; + settingPage[item_index].icon = toggleitem[infoSettings.invert_zaxis]; featureSettingsItems.items[key_val] = settingPage[item_index]; menuDrawListItem(&featureSettingsItems.items[key_val], key_val); break; @@ -316,25 +316,25 @@ void loadFeatureSettings(){ for (uint8_t i = 0; i < LISTITEM_PER_PAGE; i++) { - uint8_t item_index = fe_cur_page*FE_PAGE_COUNT + i; + uint8_t item_index = fe_cur_page*LISTITEM_PER_PAGE + i; switch (item_index) { case SKEY_HIDEACK: //item_terminalACK_i = infoSettings.terminalACK; - settingPage[SKEY_HIDEACK].icon = toggleitem[infoSettings.terminalACK]; - featureSettingsItems.items[i] = settingPage[SKEY_HIDEACK]; + settingPage[item_index].icon = toggleitem[infoSettings.terminalACK]; + featureSettingsItems.items[i] = settingPage[item_index]; break; case SKEY_INVERT_Y: //item_invert_yaxis_i = infoSettings.invert_yaxis; - settingPage[SKEY_INVERT_Y].icon = toggleitem[infoSettings.invert_yaxis]; - featureSettingsItems.items[i] = settingPage[SKEY_INVERT_Y]; + settingPage[item_index].icon = toggleitem[infoSettings.invert_yaxis]; + featureSettingsItems.items[i] = settingPage[item_index]; break; case SKEY_INVERT_Z: //item_invert_zaxis_i = infoSettings.invert_zaxis; - settingPage[SKEY_INVERT_Z].icon = toggleitem[infoSettings.invert_yaxis]; - featureSettingsItems.items[i] = settingPage[SKEY_INVERT_Z]; + settingPage[item_index].icon = toggleitem[infoSettings.invert_zaxis]; + featureSettingsItems.items[i] = settingPage[item_index]; break; #ifdef PS_ON_PIN @@ -362,6 +362,7 @@ case SKEY_SPEED: featureSettingsItems.items[i] = itemMoveSpeed[infoSettings.move_speed]; break; + default: settingPage[item_index].icon = ICONCHAR_BACKGROUND; featureSettingsItems.items[i] = settingPage[item_index]; @@ -390,9 +391,18 @@ featureSettingsItems.items[6].icon = ICONCHAR_PAGEDOWN; } } + //menuDrawListItem(&featureSettingsItems.items[5],5); + //menuDrawListItem(&featureSettingsItems.items[6],6); } + void refreshItemsDisplay(){ + for (uint8_t i = 0; i < ITEM_PER_PAGE; i++) + { + menuDrawListItem(&featureSettingsItems.items[i],i); + } + } + void menuFeatureSettings(void) { KEY_VALUES key_num = KEY_IDLE; @@ -411,22 +421,29 @@ if (fe_cur_page > 0){ fe_cur_page--; loadFeatureSettings(); + refreshItemsDisplay(); } } break; + case KEY_ICON_6: if(FE_PAGE_COUNT > 1){ - if (fe_cur_page < FE_PAGE_COUNT){ + if (fe_cur_page < FE_PAGE_COUNT - 1){ fe_cur_page++; loadFeatureSettings(); + refreshItemsDisplay(); } } break; + case KEY_ICON_7: infoMenu.cur--; break; default: + if(key_num < LISTITEM_PER_PAGE){ updateFeatureSettings(key_num); + menuDrawListItem(&featureSettingsItems.items[key_num],key_num); + } break; } diff --git a/TFT/src/User/Menu/Move.c b/TFT/src/User/Menu/Move.c index 5eacc00a7d..be9719506c 100644 --- a/TFT/src/User/Menu/Move.c +++ b/TFT/src/User/Menu/Move.c @@ -31,7 +31,7 @@ #define LABEL_ZAXIS_UP LABEL_Z_INC #define LABEL_ZAXIS_DOWN LABEL_Z_DEC #define ZGCODE_UP "G1 Z%.1f\n" - #define ZGCODE_DOWN "G1 Z%.1f\n" + #define ZGCODE_DOWN "G1 Z-%.1f\n" #endif #endif diff --git a/TFT/src/User/Menu/StatusScreen.c b/TFT/src/User/Menu/StatusScreen.c index 28dd0989a2..b197dc21b2 100644 --- a/TFT/src/User/Menu/StatusScreen.c +++ b/TFT/src/User/Menu/StatusScreen.c @@ -78,8 +78,8 @@ const GUI_RECT RectInfo = {START_X + 1 * ICON_WIDTH + 1 * SPACE_X, ICON_START_Y const GUI_RECT msgRect ={START_X + 1 * ICON_WIDTH + 1 * SPACE_X + 2, ICON_START_Y + 1 * ICON_HEIGHT + 1 * SPACE_Y + STATUS_MSG_BODY_YOFFSET, START_X + 3 * ICON_WIDTH + 2 * SPACE_X - 2, ICON_START_Y + 2 * ICON_HEIGHT + 1 * SPACE_Y - STATUS_MSG_BODY_BOTTOM}; -const GUI_RECT RecGantry = {START_X, 1*ICON_HEIGHT+0*SPACE_Y+ICON_START_Y, - 4*ICON_WIDTH+3*SPACE_X+START_X, 1*ICON_HEIGHT+1*SPACE_Y+ICON_START_Y}; +const GUI_RECT RecGantry = {START_X, 1*ICON_HEIGHT+0*SPACE_Y+ICON_START_Y + STATUS_GANTRY_YOFFSET, + 4*ICON_WIDTH+3*SPACE_X+START_X, 1*ICON_HEIGHT+1*SPACE_Y+ICON_START_Y - STATUS_GANTRY_YOFFSET}; /*set status icons */ @@ -99,7 +99,7 @@ void drawTemperature(void) char tempstr[100]; GUI_SetTextMode(GUI_TEXTMODE_TRANS); GUI_SetColor(HEADING_COLOR); - menuDrawItem(&ToolItems[0],0); //Ext icon + menuDrawIconOnly(&ToolItems[0],0); //Ext icon GUI_DispStringRight(pointID[0].x, pointID[0].y, (u8 *)heatDisplayID[current_Ext]); //Ext label GUI_SetColor(VAL_COLOR); @@ -107,14 +107,14 @@ void drawTemperature(void) GUI_DispStringInPrect(&rectB[0], (u8 *)tempstr); //Ext value GUI_SetColor(HEADING_COLOR); - menuDrawItem(&ToolItems[1],1); //Bed icon + menuDrawIconOnly(&ToolItems[1],1); //Bed icon GUI_DispStringRight(pointID[1].x, pointID[1].y, (u8 *)heatDisplayID[BED]); //Bed label GUI_SetColor(VAL_COLOR); my_sprintf(tempstr, "%d/%d", heatGetCurrentTemp(BED), heatGetTargetTemp(BED)); GUI_DispStringInPrect(&rectB[1], (u8 *)tempstr); //Bed value GUI_SetColor(HEADING_COLOR); - menuDrawItem(&ToolItems[2],2); //Fan icon + menuDrawIconOnly(&ToolItems[2],2); //Fan icon GUI_DispStringRight(pointID[2].x, pointID[2].y, (u8 *)fanID[current_fan]); //Fan label GUI_SetColor(VAL_COLOR); @@ -129,7 +129,7 @@ void drawTemperature(void) GUI_DispStringInPrect(&rectB[2], (u8 *)tempstr); //Fan value GUI_SetColor(HEADING_COLOR); - menuDrawItem(&SpeedItems[current_speedID],3); //Speed / flow icon + menuDrawIconOnly(&SpeedItems[current_speedID],3); //Speed / flow icon GUI_DispStringRight(pointID[3].x, pointID[3].y, (u8 *)SpeedID[current_speedID]); //Speed / flow label GUI_SetColor(VAL_COLOR); my_sprintf(tempstr, "%d%s", speedGetPercent(current_speedID),"%"); @@ -138,7 +138,7 @@ void drawTemperature(void) GUI_SetTextMode(GUI_TEXTMODE_NORMAL); GUI_SetColor(GANTRYLBL_COLOR); GUI_SetBkColor(GANTRYLBL_BKCOLOR); - my_sprintf(tempstr, "X: %.2f Y: %.2f Z: %.2f", xaxis, yaxis, zaxis); + my_sprintf(tempstr, " X: %.2f Y: %.2f Z: %.2f ", xaxis, yaxis, zaxis); GUI_DispStringInPrect(&RecGantry,(u8 *)tempstr); GUI_RestoreColorDefault(); diff --git a/TFT/src/User/Menu/StatusScreen.h b/TFT/src/User/Menu/StatusScreen.h index 2c2a289997..09338b80cc 100644 --- a/TFT/src/User/Menu/StatusScreen.h +++ b/TFT/src/User/Menu/StatusScreen.h @@ -40,6 +40,7 @@ void gantry_inc(int n, float val); #define STATUS_MSG_BODY_YOFFSET 59 #define STATUS_MSG_BODY_BOTTOM 6 #define STATUS_TITLE_SHORT 20 + #define STATUS_GANTRY_YOFFSET 6 #elif defined(TFT28_V1_0) || defined(TFT24_V1_1) @@ -58,7 +59,7 @@ void gantry_inc(int n, float val); #define STATUS_MSG_BODY_BOTTOM 4 #define STATUS_TITLE_SHORT 10 #define SS_ICON_START_Y 30 - #define STATUS_GANTRY_YOFFSET 6 + #define STATUS_GANTRY_YOFFSET 4 #endif #endif diff --git a/TFT/src/User/Menu/menu.c b/TFT/src/User/Menu/menu.c index e56f8b1d57..7216178288 100644 --- a/TFT/src/User/Menu/menu.c +++ b/TFT/src/User/Menu/menu.c @@ -98,6 +98,16 @@ void menuDrawItem(const ITEM *item, uint8_t positon) GUI_DispStringInPrect(rect, content); } +void menuDrawIconOnly(const ITEM *item, uint8_t positon) +{ + uint8_t *content = labelGetAddress(&item->label); + const GUI_RECT *rect = rect_of_key + positon; + if(item->icon != ICON_BACKGROUND) + ICON_ReadDisplay(rect->x0, rect->y0, item->icon); + else + GUI_ClearPrect(rect); +} + void menuDrawListItem(const LISTITEM *item, uint8_t position) { const GUI_RECT *rect = rect_of_keyListView + position; diff --git a/TFT/src/User/Menu/menu.h b/TFT/src/User/Menu/menu.h index b0979c14bb..75eb44e1ba 100644 --- a/TFT/src/User/Menu/menu.h +++ b/TFT/src/User/Menu/menu.h @@ -103,6 +103,7 @@ void busyIndicator(SYS_STATUS status); void GUI_RestoreColorDefault(void); void menuDrawItem (const ITEM * menuItem, uint8_t positon); +void menuDrawIconOnly(const ITEM *item, uint8_t positon); void menuDrawListItem(const LISTITEM *item, uint8_t positon); void menuDrawTitle(const uint8_t *content); //(const MENUITEMS * menuItems); void menuDrawPage (const MENUITEMS * menuItems);