feat: Implement button creation utility and refactor UI components for improved readability
This commit is contained in:
12
main/ui/widgets/button.cpp
Normal file
12
main/ui/widgets/button.cpp
Normal 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
4
main/ui/widgets/button.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
#include "lvgl.h"
|
||||
|
||||
lv_obj_t* button_create(lv_obj_t* parent);
|
||||
4
main/ui/widgets/widgets.h
Normal file
4
main/ui/widgets/widgets.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include "main/ui/widgets/button.h"
|
||||
#include "main/ui/widgets/textarea.h"
|
||||
Reference in New Issue
Block a user