Move screen for Color UI (#19386)

This commit is contained in:
Victor Oliveira
2020-09-17 08:52:21 -03:00
committed by GitHub
parent 62206c0386
commit 5b56d6698a
15 changed files with 662 additions and 6 deletions

View File

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