From 9685b53bf1b0ea6635ea9208421d85d2ed8bcafc Mon Sep 17 00:00:00 2001 From: rasmus Date: Wed, 14 Jan 2026 18:28:02 +0100 Subject: [PATCH] Commit before I fuck everything up --- Desktop_Test/Desktop_Test.ino | 2 +- Desktop_Test/example_programs.h | 4 ++-- Desktop_Test/program.h | 2 ++ Desktop_Test/tft_handler.cpp | 12 ++++++------ Desktop_Test/tft_handler.h | 12 ++++++------ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Desktop_Test/Desktop_Test.ino b/Desktop_Test/Desktop_Test.ino index c3a3899..4d5a2f8 100644 --- a/Desktop_Test/Desktop_Test.ino +++ b/Desktop_Test/Desktop_Test.ino @@ -66,7 +66,7 @@ void setup() { _shell->init(th, _display_state, sm); // Create input task on Core 0 - xTaskCreatePinnedToCore(input_task, "input_task", 4096, NULL, 1, &InputTask, 0); + xTaskCreatePinnedToCore(input_task, "input_task", 4096, NULL, 15, &InputTask, 0); delay(100); diff --git a/Desktop_Test/example_programs.h b/Desktop_Test/example_programs.h index 975b521..8c3c173 100644 --- a/Desktop_Test/example_programs.h +++ b/Desktop_Test/example_programs.h @@ -186,7 +186,7 @@ public: show_resources.x = _window->x + 7; show_resources.y = _window->y + 40; show_resources.width = 80; - show_resources.height = 10; + show_resources.height = 15; show_resources.pressed = true; ContentButton show_tasks; @@ -194,7 +194,7 @@ public: show_tasks.x = _window->x + show_resources.width + 13; show_tasks.y = _window->y + 40; show_tasks.width = 70; - show_tasks.height = 10; + show_tasks.height = 15; show_tasks.pressed = false; _window->content_buttons.push_back(show_resources); diff --git a/Desktop_Test/program.h b/Desktop_Test/program.h index 883e15a..45606b5 100644 --- a/Desktop_Test/program.h +++ b/Desktop_Test/program.h @@ -54,6 +54,8 @@ struct WindowContentText { short x; short y; char size; + bool selectable = false; + bool selected = false; }; struct ContentButton { diff --git a/Desktop_Test/tft_handler.cpp b/Desktop_Test/tft_handler.cpp index 35dd55a..15cfe4c 100644 --- a/Desktop_Test/tft_handler.cpp +++ b/Desktop_Test/tft_handler.cpp @@ -15,25 +15,25 @@ void TFT_Handler::init(DISPLAY_STATE* display_state) { sprite.fillScreen(0x0000); } -void TFT_Handler::draw_box(short int x, short int y, short int size_x, short int size_y, int color) { +void TFT_Handler::draw_box(short x, short y, short size_x, short size_y, short color) { sprite.fillRect(x, y, size_x, size_y, color); } -void TFT_Handler::draw_rect(short int x, short int y, short int size_x, short int size_y, short int thickness, int color) { +void TFT_Handler::draw_rect(short x, short y, short size_x, short size_y, short thickness, short color) { sprite.drawRect(x, y, size_x, size_y, color); } -void TFT_Handler::draw_line(short int x1, short int y1, short int x2, short int y2, int color) { +void TFT_Handler::draw_line(short x1, short y1, short x2, short y2, short color) { sprite.drawLine(x1, y1, x2, y2, color); } -void TFT_Handler::draw_text(short int x, short int y, const std::string& str, int color, short int size) { +void TFT_Handler::draw_text(short x, short y, const std::string& str, short color, short size) { sprite.setTextColor(color); sprite.setTextSize(size); sprite.drawString(str.c_str(), x, y); } -void TFT_Handler::draw_button(short x, short y, short size_x, short size_y, int color, bool pressed, std::string str) { +void TFT_Handler::draw_button(short x, short y, short size_x, short size_y, short color, bool pressed, std::string str) { if (pressed) { sprite.fillRect(x - 2, y - 2, size_x + 2, size_y + 2, COL_BLACK); sprite.fillRect(x - 1, y - 1, size_x + 1, size_y + 1, COL_DARK_GREY); @@ -51,7 +51,7 @@ void TFT_Handler::draw_button(short x, short y, short size_x, short size_y, int } } -void TFT_Handler::fill_screen(int color) { +void TFT_Handler::fill_screen(short color) { sprite.fillScreen(color); } diff --git a/Desktop_Test/tft_handler.h b/Desktop_Test/tft_handler.h index f612ba1..d1882b8 100644 --- a/Desktop_Test/tft_handler.h +++ b/Desktop_Test/tft_handler.h @@ -61,11 +61,11 @@ public: void init(DISPLAY_STATE* display_state); - void draw_box(short x, short y, short size_x, short size_y, int color); - void draw_rect(short x, short y, short size_x, short size_y, short int thickness, int color); - void draw_line(short x1, short y1, short x2, short y2, int color); - void draw_text(short x, short y, const std::string& str, int color, short int size); - void draw_button(short x, short y, short size_x, short size_y, int color, bool pressed, std::string str); - void fill_screen(int color); + void draw_box(short x, short y, short size_x, short size_y, short color); + void draw_rect(short x, short y, short size_x, short size_y, short thickness, short color); + void draw_line(short x1, short y1, short x2, short y2, short color); + void draw_text(short x, short y, const std::string& str, short color, short size); + void draw_button(short x, short y, short size_x, short size_y, short color, bool pressed, std::string str); + void fill_screen(short color); void push_sprite(); };