Browse Source

Color UI single touch menu navigation (#20053)

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

4
Marlin/Configuration.h

@ -2343,6 +2343,10 @@
//#define XPT2046_Y_CALIBRATION -8981
//#define XPT2046_X_OFFSET -43
//#define XPT2046_Y_OFFSET 257
#if ENABLED(TFT_COLOR_UI)
//#define SINGLE_TOUCH_NAVIGATION
#endif
#endif
//

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

@ -206,7 +206,10 @@ 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: ui.lcd_clicked = true; break;
case CLICK:
TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data);
ui.lcd_clicked = true;
break;
#if HAS_RESUME_CONTINUE
case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
#endif

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

@ -647,7 +647,10 @@ void menu_item(const uint8_t row, bool sel ) {
#endif
menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
TERN_(TOUCH_SCREEN, touch.add_control(sel ? CLICK : MENU_ITEM, 0, 2 + 34 * row, 320, 32, encoderTopLine + row));
#if ENABLED(TOUCH_SCREEN)
const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM;
touch.add_control(tct, 0, 2 + 34 * row, 320, 32, encoderTopLine + row);
#endif
}
void MarlinUI::move_axis_screen() {

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

@ -652,7 +652,10 @@ void menu_item(const uint8_t row, bool sel ) {
#endif
menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
TERN_(TOUCH_SCREEN, touch.add_control(sel ? CLICK : MENU_ITEM, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row));
#if ENABLED(TOUCH_SCREEN)
const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM;
touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row);
#endif
}
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)

Loading…
Cancel
Save