Commit before I fuck everything up

This commit is contained in:
Rasmus Rasmussen 2026-01-14 18:28:02 +01:00
parent 1cb93af0bc
commit 9685b53bf1
5 changed files with 17 additions and 15 deletions

View File

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

View File

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

View File

@ -54,6 +54,8 @@ struct WindowContentText {
short x;
short y;
char size;
bool selectable = false;
bool selected = false;
};
struct ContentButton {

View File

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

View File

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