fix: remove click-focusable flag from container widgets and add high-contrast outline focus style to launcher buttons for monochrome display navigation
This commit is contained in:
@@ -49,6 +49,11 @@ class LauncherApp final : public App {
|
||||
lv_obj_set_style_shadow_width(apps_button, 0, LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(apps_button, 0, LV_STATE_DEFAULT);
|
||||
|
||||
// Add a high-contrast focus outline for monochrome / RLCD screens
|
||||
lv_obj_set_style_outline_width(apps_button, 2, LV_STATE_FOCUSED);
|
||||
lv_obj_set_style_outline_pad(apps_button, 2, LV_STATE_FOCUSED);
|
||||
lv_obj_set_style_outline_color(apps_button, lv_theme_get_color_primary(apps_button), LV_STATE_FOCUSED);
|
||||
|
||||
// create the image first
|
||||
auto* button_image = lv_image_create(apps_button);
|
||||
lv_obj_set_style_text_font(button_image, lvgl_get_launcher_icon_font(), LV_STATE_DEFAULT);
|
||||
@@ -162,7 +167,11 @@ public:
|
||||
}
|
||||
|
||||
void onShow(AppContext& app, lv_obj_t* parent) override {
|
||||
// Remove click-focusable flag from parent container to prevent it from stealing focus
|
||||
lv_obj_remove_flag(parent, LV_OBJ_FLAG_CLICK_FOCUSABLE);
|
||||
|
||||
auto* buttons_wrapper = lv_obj_create(parent);
|
||||
lv_obj_remove_flag(buttons_wrapper, LV_OBJ_FLAG_CLICK_FOCUSABLE);
|
||||
|
||||
auto ui_density = lvgl_get_ui_density();
|
||||
const auto button_size = lvgl_get_launcher_icon_font_height();
|
||||
|
||||
Reference in New Issue
Block a user