mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-17 02:45:05 +00:00
- Implemented themes with LSS: material, material mono - Implemented grid-based navigation - Added new Launcher - Updated Appearance app to add theme configuration - Updated various apps to improve UX/UI - Added LVGL widgets: cards, badges, chips, icon buttons - Added support for round/rounded displays - Added the concept of insets to LVGL and implemented it in toolbar + statusbar - Terminal app now hides toolbar by default, but tapping the terminal toggles visibility - File browsing now opens the configured user-data location by default - Added missing licenses to subprojects - Updated README.md screenshots and intro text
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
// SPDX-License-Identifier: Apache-2.0
|
|
#define LV_USE_PRIVATE_API 1 // For the lv_obj_class_t declaration
|
|
|
|
#include <lvgl/widgets/badge.h>
|
|
|
|
static void badge_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj) {
|
|
LV_UNUSED(class_p);
|
|
lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
|
lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
|
lv_obj_add_flag(obj, LV_OBJ_FLAG_IGNORE_LAYOUT);
|
|
}
|
|
|
|
// Not static: the theme styles badges by this class
|
|
extern "C" const lv_obj_class_t lvgl_badge_class = {
|
|
.base_class = &lv_obj_class,
|
|
.constructor_cb = badge_constructor,
|
|
.destructor_cb = nullptr,
|
|
.event_cb = nullptr,
|
|
.user_data = nullptr,
|
|
.name = "badge",
|
|
.width_def = 0,
|
|
.height_def = 0,
|
|
.editable = LV_OBJ_CLASS_EDITABLE_INHERIT,
|
|
.group_def = LV_OBJ_CLASS_GROUP_DEF_FALSE,
|
|
.instance_size = 0,
|
|
.theme_inheritable = LV_OBJ_CLASS_THEME_INHERITABLE_FALSE
|
|
};
|
|
|
|
lv_obj_t* lvgl_badge_create(lv_obj_t* parent) {
|
|
lv_obj_t* obj = lv_obj_class_create_obj(&lvgl_badge_class, parent);
|
|
lv_obj_class_init_obj(obj);
|
|
return obj;
|
|
}
|