diff --git a/CHANGELOG.md b/CHANGELOG.md index 7767107..c0e64a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ If a change only affects particular applications, they are listed in parentheses - feat(buffyboard): Allow disabling input devices via config - feat(buffyboard): Add CLI flags for overriding geometry & DPI - fix(unl0kr): Shutdown message box doesn't close on decline +- fix(unl0kr): Shutdown message box buttons are unstyled - misc: Update lvgl to git master (2023-03-30) ## 3.0.0 (2024-03-22) diff --git a/shared/theme.c b/shared/theme.c index d2424f2..db9c8c1 100644 --- a/shared/theme.c +++ b/shared/theme.c @@ -37,7 +37,6 @@ static struct { lv_style_t label; lv_style_t msgbox; lv_style_t msgbox_label; - lv_style_t msgbox_btnmatrix; lv_style_t msgbox_background; lv_style_t bar; lv_style_t bar_indicator; @@ -197,10 +196,6 @@ static void init_styles(const bbx_theme *theme) { lv_style_set_text_align(&(styles.msgbox_label), LV_TEXT_ALIGN_CENTER); lv_style_set_pad_bottom(&(styles.msgbox_label), lv_dpx(theme->msgbox.gap)); - reset_style(&(styles.msgbox_btnmatrix)); - lv_style_set_pad_gap(&(styles.msgbox_btnmatrix), lv_dpx(theme->msgbox.buttons.gap)); - lv_style_set_min_width(&(styles.msgbox_btnmatrix), LV_PCT(100)); - reset_style(&(styles.msgbox_background)); lv_style_set_bg_color(&(styles.msgbox_background), lv_color_hex(theme->msgbox.dimming.color)); lv_style_set_bg_opa(&(styles.msgbox_background), theme->msgbox.dimming.opacity); @@ -295,10 +290,9 @@ static void apply_theme_cb(lv_theme_t *theme, lv_obj_t *obj) { return; /* Inherit styling from message box */ } - if (lv_obj_check_type(obj, &lv_buttonmatrix_class) && lv_obj_check_type(lv_obj_get_parent(obj), &lv_msgbox_class)) { - lv_obj_add_style(obj, &(styles.msgbox_btnmatrix), 0); - lv_obj_add_style(obj, &(styles.button), LV_PART_ITEMS); - lv_obj_add_style(obj, &(styles.button_pressed), LV_PART_ITEMS | LV_STATE_PRESSED); + if (lv_obj_check_type(obj, &lv_msgbox_footer_button_class)) { + lv_obj_add_style(obj, &(styles.button), 0); + lv_obj_add_style(obj, &(styles.button_pressed), LV_STATE_PRESSED); return; } diff --git a/shared/theme.h b/shared/theme.h index d4e6aed..3ee3b1c 100644 --- a/shared/theme.h +++ b/shared/theme.h @@ -123,11 +123,6 @@ typedef struct { uint32_t fg_color; } bbx_theme_label; -/* Message box buttons theme */ -typedef struct { - lv_coord_t gap; -} bbx_theme_msgbox_buttons; - /* Message box dimming theme */ typedef struct { uint32_t color; @@ -143,7 +138,6 @@ typedef struct { lv_coord_t corner_radius; lv_coord_t pad; lv_coord_t gap; - bbx_theme_msgbox_buttons buttons; bbx_theme_msgbox_dimming dimming; } bbx_theme_msgbox; diff --git a/shared/themes.c b/shared/themes.c index b25ffa8..e9ab2cb 100644 --- a/shared/themes.c +++ b/shared/themes.c @@ -154,9 +154,6 @@ static const bbx_theme breezy_light = { .corner_radius = 0, .pad = 20, .gap = 20, - .buttons = { - .gap = 5 - }, .dimming = { .color = 0x232629, .opacity = 178 @@ -312,9 +309,6 @@ static const bbx_theme breezy_dark = { .corner_radius = 0, .pad = 20, .gap = 20, - .buttons = { - .gap = 5 - }, .dimming = { .color = 0x232629, .opacity = 178 @@ -469,9 +463,6 @@ static const bbx_theme pmos_light = { .corner_radius = 3, .pad = 20, .gap = 20, - .buttons = { - .gap = 10 - }, .dimming = { .color = 0x070c0d, .opacity = 225 @@ -626,9 +617,6 @@ static const bbx_theme pmos_dark = { .corner_radius = 3, .pad = 20, .gap = 20, - .buttons = { - .gap = 10 - }, .dimming = { .color = 0x070c0d, .opacity = 225 diff --git a/unl0kr/main.c b/unl0kr/main.c index 91039ca..f016540 100644 --- a/unl0kr/main.c +++ b/unl0kr/main.c @@ -296,7 +296,7 @@ static void shutdown_mbox_confirmed_cb(lv_event_t *event) { } static void shutdown_mbox_declined_cb(lv_event_t *event) { - // Find the containing message box for the clicked button + /* Find the containing message box for the clicked button */ lv_obj_t *obj = lv_event_get_target(event); while (obj && !lv_obj_check_type(obj, &lv_msgbox_class)) { obj = lv_obj_get_parent(obj);