From 925b56d16e82f9d2b02304e1a80119a8027b203e Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Sat, 30 Mar 2024 20:08:00 +0100 Subject: [PATCH] Fix naming --- shared/theme.c | 8 ++++---- shared/theme.h | 4 ++-- shared/themes.c | 10 +++++----- shared/themes.h | 2 +- unl0kr/main.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/shared/theme.c b/shared/theme.c index d07df41..dc7ca5d 100644 --- a/shared/theme.c +++ b/shared/theme.c @@ -16,7 +16,7 @@ * Static variables */ -static ul_theme current_theme; +static bb_theme current_theme; static lv_theme_t lv_theme; static struct { @@ -55,7 +55,7 @@ static bool are_styles_initialised = false; * * @param theme theme to derive the styles from */ -static void init_styles(const ul_theme *theme); +static void init_styles(const bb_theme *theme); /** * Initialise or reset a style. @@ -84,7 +84,7 @@ static void keyboard_draw_task_added_cb(lv_event_t *event); * Static functions */ -static void init_styles(const ul_theme *theme) { +static void init_styles(const bb_theme *theme) { reset_style(&(styles.widget)); lv_style_set_text_font(&(styles.widget), &font_32); @@ -369,7 +369,7 @@ void bb_theme_prepare_keyboard(lv_obj_t *keyboard) { lv_obj_add_flag(keyboard, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); } -void bb_theme_apply(const ul_theme *theme) { +void bb_theme_apply(const bb_theme *theme) { if (!theme) { bb_log(BB_LOG_LEVEL_ERROR, "Could not apply theme from NULL pointer"); return; diff --git a/shared/theme.h b/shared/theme.h index 62006c8..1b62d3c 100644 --- a/shared/theme.h +++ b/shared/theme.h @@ -172,7 +172,7 @@ typedef struct { bb_theme_label label; bb_theme_msgbox msgbox; bb_theme_bar bar; -} ul_theme; +} bb_theme; /** * Prepare a keyboard widget to be themed with a theme. @@ -186,6 +186,6 @@ void bb_theme_prepare_keyboard(lv_obj_t *keyboard); * * @param theme the theme to apply */ -void bb_theme_apply(const ul_theme *theme); +void bb_theme_apply(const bb_theme *theme); #endif /* BB_THEME_H */ diff --git a/shared/themes.c b/shared/themes.c index d451290..ccdb3c6 100644 --- a/shared/themes.c +++ b/shared/themes.c @@ -16,7 +16,7 @@ */ /* Breezy light (based on KDE Breeze color palette, see https://develop.kde.org/hig/style/color/default/) */ -static const ul_theme bb_themes_breezy_light = { +static const bb_theme bb_themes_breezy_light = { .name = "breezy-light", .window = { .bg_color = 0xeff0f1 @@ -174,7 +174,7 @@ static const ul_theme bb_themes_breezy_light = { /* Breezy dark (based on KDE Breeze Dark color palette, see https://develop.kde.org/hig/style/color/dark/) */ -static const ul_theme bb_themes_breezy_dark = { +static const bb_theme bb_themes_breezy_dark = { .name = "breezy-dark", .window = { .bg_color = 0x31363b @@ -331,7 +331,7 @@ static const ul_theme bb_themes_breezy_dark = { }; /* pmOS light (based on palette https://coolors.co/009900-395e66-db504a-e3b505-ebf5ee) */ -static const ul_theme bb_themes_pmos_light = { +static const bb_theme bb_themes_pmos_light = { .name = "pmos-light", .window = { .bg_color = 0xf2f7f8, @@ -488,7 +488,7 @@ static const ul_theme bb_themes_pmos_light = { }; /* pmOS dark (based on palette https://coolors.co/009900-395e66-db504a-e3b505-ebf5ee) */ -static const ul_theme bb_themes_pmos_dark = { +static const bb_theme bb_themes_pmos_dark = { .name = "pmos-dark", .window = { .bg_color = 0x070c0d @@ -649,7 +649,7 @@ static const ul_theme bb_themes_pmos_dark = { */ const int bb_themes_num_themes = 4; -const ul_theme *bb_themes_themes[] = { +const bb_theme *bb_themes_themes[] = { &bb_themes_breezy_light, &bb_themes_breezy_dark, &bb_themes_pmos_light, diff --git a/shared/themes.h b/shared/themes.h index 957bf7c..0addaa6 100644 --- a/shared/themes.h +++ b/shared/themes.h @@ -20,7 +20,7 @@ typedef enum { /* Themes */ extern const int bb_themes_num_themes; -extern const ul_theme *bb_themes_themes[]; +extern const bb_theme *bb_themes_themes[]; /** * Find the first theme with a given name. diff --git a/unl0kr/main.c b/unl0kr/main.c index 5613f42..3321919 100644 --- a/unl0kr/main.c +++ b/unl0kr/main.c @@ -78,7 +78,7 @@ static void set_theme(bool is_alternate); * * @param is_alternate true if the alternate theme should be selected, false if the default theme should be selected */ -static const ul_theme * get_theme(bool is_alternate); +static const bb_theme * get_theme(bool is_alternate); /** * Handle LV_EVENT_CLICKED events from the show/hide password toggle button. @@ -223,7 +223,7 @@ static void set_theme(bool is_alternate) { bb_theme_apply(get_theme(is_alternate)); } -static const ul_theme * get_theme(bool is_alternate) { +static const bb_theme * get_theme(bool is_alternate) { return bb_themes_themes[is_alternate ? conf_opts.theme.alternate_id : conf_opts.theme.default_id]; }