Browse Source

SINGLE_TOUCH_NAVIGATION Follow Up (#20213)

vanilla_fb_2.0.x
Victor Oliveira 4 years ago
committed by Scott Lahteine
parent
commit
264e921d3f
  1. 3
      Marlin/src/lcd/tft/touch.cpp
  2. 1
      Marlin/src/lcd/tft/touch.h
  3. 2
      Marlin/src/lcd/tft/ui_320x240.cpp
  4. 2
      Marlin/src/lcd/tft/ui_480x320.cpp

3
Marlin/src/lcd/tft/touch.cpp

@ -156,10 +156,11 @@ void Touch::touch(touch_control_t *control) {
case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break; case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break;
case BACK: ui.goto_previous_screen(); break; case BACK: ui.goto_previous_screen(); break;
case CLICK: case MENU_CLICK:
TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data); TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data);
ui.lcd_clicked = true; ui.lcd_clicked = true;
break; break;
case CLICK: ui.lcd_clicked = true; break;
#if HAS_RESUME_CONTINUE #if HAS_RESUME_CONTINUE
case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break; case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
#endif #endif

1
Marlin/src/lcd/tft/touch.h

@ -45,6 +45,7 @@ enum TouchControlType : uint16_t {
PAGE_UP, PAGE_UP,
PAGE_DOWN, PAGE_DOWN,
CLICK, CLICK,
MENU_CLICK,
RESUME_CONTINUE, RESUME_CONTINUE,
SLIDER, SLIDER,
INCREASE, INCREASE,

2
Marlin/src/lcd/tft/ui_320x240.cpp

@ -652,7 +652,7 @@ void menu_item(const uint8_t row, bool sel ) {
menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
#if ENABLED(TOUCH_SCREEN) #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); touch.add_control(tct, 0, 2 + 34 * row, TFT_WIDTH, 32, encoderTopLine + row);
#endif #endif
} }

2
Marlin/src/lcd/tft/ui_480x320.cpp

@ -659,7 +659,7 @@ void menu_item(const uint8_t row, bool sel ) {
menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
#if ENABLED(TOUCH_SCREEN) #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); touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row);
#endif #endif
} }

Loading…
Cancel
Save