Kaynağa Gözat

Color UI single touch menu navigation (#20053)

Victor Oliveira 3 yıl önce
ebeveyn
işleme
2fdeceda58
No account linked to committer's email address

+ 4
- 0
Marlin/Configuration.h Dosyayı Görüntüle

2343
   //#define XPT2046_Y_CALIBRATION -8981
2343
   //#define XPT2046_Y_CALIBRATION -8981
2344
   //#define XPT2046_X_OFFSET        -43
2344
   //#define XPT2046_X_OFFSET        -43
2345
   //#define XPT2046_Y_OFFSET        257
2345
   //#define XPT2046_Y_OFFSET        257
2346
+
2347
+  #if ENABLED(TFT_COLOR_UI)
2348
+    //#define SINGLE_TOUCH_NAVIGATION
2349
+  #endif
2346
 #endif
2350
 #endif
2347
 
2351
 
2348
 //
2352
 //

+ 4
- 1
Marlin/src/lcd/tft/touch.cpp Dosyayı Görüntüle

206
 
206
 
207
     case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break;
207
     case MENU_SCREEN: ui.goto_screen((screenFunc_t)control->data); break;
208
     case BACK: ui.goto_previous_screen(); break;
208
     case BACK: ui.goto_previous_screen(); break;
209
-    case CLICK: ui.lcd_clicked = true; break;
209
+    case CLICK:
210
+      TERN_(SINGLE_TOUCH_NAVIGATION, ui.encoderPosition = control->data);
211
+      ui.lcd_clicked = true;
212
+      break;
210
     #if HAS_RESUME_CONTINUE
213
     #if HAS_RESUME_CONTINUE
211
       case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
214
       case RESUME_CONTINUE: extern bool wait_for_user; wait_for_user = false; break;
212
     #endif
215
     #endif

+ 4
- 1
Marlin/src/lcd/tft/ui_320x240.cpp Dosyayı Görüntüle

647
   #endif
647
   #endif
648
 
648
 
649
   menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
649
   menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
650
-  TERN_(TOUCH_SCREEN, touch.add_control(sel ? CLICK : MENU_ITEM, 0, 2 + 34 * row, 320, 32, encoderTopLine + row));
650
+  #if ENABLED(TOUCH_SCREEN)
651
+    const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM;
652
+    touch.add_control(tct, 0, 2 + 34 * row, 320, 32, encoderTopLine + row);
653
+  #endif
651
 }
654
 }
652
 
655
 
653
 void MarlinUI::move_axis_screen() {
656
 void MarlinUI::move_axis_screen() {

+ 4
- 1
Marlin/src/lcd/tft/ui_480x320.cpp Dosyayı Görüntüle

652
   #endif
652
   #endif
653
 
653
 
654
   menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
654
   menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND);
655
-  TERN_(TOUCH_SCREEN, touch.add_control(sel ? CLICK : MENU_ITEM, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row));
655
+  #if ENABLED(TOUCH_SCREEN)
656
+    const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? CLICK : MENU_ITEM;
657
+    touch.add_control(tct, 0, 4 + 45 * row, TFT_WIDTH, 43, encoderTopLine + row);
658
+  #endif
656
 }
659
 }
657
 
660
 
658
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
661
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET)

Loading…
İptal
Kaydet