Color UI single touch menu navigation (#20053)

This commit is contained in:
Victor Oliveira 2020-11-07 06:00:29 -03:00 committed by Scott Lahteine
parent 7e94079b5b
commit af5cf823ea
4 changed files with 16 additions and 3 deletions

View file

@ -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
//

View file

@ -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

View file

@ -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() {

View file

@ -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)