Skip to content

Commit

Permalink
SINGLE_TOUCH_NAVIGATION Follow Up (MarlinFirmware#20213)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv authored and thinkyhead committed Apr 29, 2021
1 parent 89e8440 commit bbb37c7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Marlin/src/lcd/tft/touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ void Touch::touch(touch_control_t *control) {

case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break;
case BACK: ui.goto_previous_screen(); break;
case CLICK:
case MENU_CLICK:
TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data);
ui.lcd_clicked = true;
break;
case CLICK: ui.lcd_clicked = true; break;
#if HAS_RESUME_CONTINUE
case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
#endif
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/tft/touch.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum TouchControlType : uint16_t {
PAGE_UP,
PAGE_DOWN,
CLICK,
MENU_CLICK,
RESUME_CONTINUE,
SLIDER,
INCREASE,
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/tft/ui_320x240.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ void menu_item(const uint8_t row, bool sel ) {

menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
#if ENABLED(TOUCH_SCREEN)
const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM;
const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? MENU_CLICK : MENU_ITEM;
touch.add_control(tct, 0, 2 + 34 * row, TFT_WIDTH, 32, encoderTopLine + row);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/tft/ui_480x320.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ void menu_item(const uint8_t row, bool sel ) {

menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
#if ENABLED(TOUCH_SCREEN)
const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM;
const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? MENU_CLICK : MENU_ITEM;
touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row);
#endif
}
Expand Down

0 comments on commit bbb37c7

Please sign in to comment.