Move screen for Color UI (#19386)
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "tft.h"
|
||||
|
||||
bool Touch::enabled = true;
|
||||
int16_t Touch::x, Touch::y;
|
||||
touch_control_t Touch::controls[];
|
||||
touch_control_t *Touch::current_control;
|
||||
@@ -54,6 +55,7 @@ void Touch::init() {
|
||||
calibration_reset();
|
||||
reset();
|
||||
io.Init();
|
||||
enable();
|
||||
}
|
||||
|
||||
void Touch::add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t width, uint16_t height, int32_t data) {
|
||||
@@ -72,6 +74,8 @@ void Touch::idle() {
|
||||
uint16_t i;
|
||||
int16_t _x, _y;
|
||||
|
||||
if (!enabled) return;
|
||||
|
||||
if (now == millis()) return;
|
||||
now = millis();
|
||||
|
||||
@@ -253,6 +257,13 @@ void Touch::touch(touch_control_t *control) {
|
||||
case UBL: hold(control, UBL_REPEAT_DELAY); ui.encoderPosition += control->data; break;
|
||||
#endif
|
||||
|
||||
case MOVE_AXIS:
|
||||
ui.goto_screen((screenFunc_t)ui.move_axis_screen);
|
||||
break;
|
||||
|
||||
// TODO: TOUCH could receive data to pass to the callback
|
||||
case BUTTON: ((screenFunc_t)control->data)(); break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user