feat: Implement button creation utility and refactor UI components for improved readability

This commit is contained in:
GW_MC
2026-02-03 15:20:35 +08:00
parent f5fae825d6
commit 7bd230f591
5 changed files with 67 additions and 86 deletions

View File

@@ -0,0 +1,12 @@
#include "ui/widgets/button.h"
lv_obj_t* button_create(lv_obj_t* parent) {
lv_obj_t* button = lv_button_create(parent);
lv_obj_set_style_bg_color(button, lv_color_white(), 0);
lv_obj_set_style_border_color(button, lv_color_black(), 0);
lv_obj_set_style_border_width(button, 2, 0);
lv_anim_delete(button, nullptr);
return button;
}

4
main/ui/widgets/button.h Normal file
View File

@@ -0,0 +1,4 @@
#pragma once
#include "lvgl.h"
lv_obj_t* button_create(lv_obj_t* parent);

View File

@@ -0,0 +1,4 @@
#pragma once
#include "main/ui/widgets/button.h"
#include "main/ui/widgets/textarea.h"