summaryrefslogtreecommitdiff
path: root/app/src/display/widgets/layer_status.c
diff options
context:
space:
mode:
authorPeter Johanson <peter@peterjohanson.com>2021-04-01 21:22:48 -0400
committerPete Johanson <peter@peterjohanson.com>2021-09-25 19:43:20 -0400
commit3e6a3758edf1960c64d1d8b0424ac84283166f52 (patch)
tree64e0214ca9845c8c9d70c51ec464cd9e495e63e0 /app/src/display/widgets/layer_status.c
parent2128b2b55f85a6190194d83696f7419eb53c6642 (diff)
refactor(display): Saner font selection/defaults.
* Only select fonts for the default built in status screen * Leverage theme default fonts, instead of hardcoding theme details in each component.
Diffstat (limited to 'app/src/display/widgets/layer_status.c')
-rw-r--r--app/src/display/widgets/layer_status.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/app/src/display/widgets/layer_status.c b/app/src/display/widgets/layer_status.c
index 3c63565..32bdb82 100644
--- a/app/src/display/widgets/layer_status.c
+++ b/app/src/display/widgets/layer_status.c
@@ -16,28 +16,12 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/keymap.h>
static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets);
-static lv_style_t label_style;
-
-static bool style_initialized = false;
struct layer_status_state {
uint8_t index;
const char *label;
};
-static void layer_status_init() {
- if (style_initialized) {
- return;
- }
-
- style_initialized = true;
- lv_style_init(&label_style);
- lv_style_set_text_color(&label_style, LV_STATE_DEFAULT, LV_COLOR_BLACK);
- lv_style_set_text_font(&label_style, LV_STATE_DEFAULT, &lv_font_montserrat_12);
- lv_style_set_text_letter_space(&label_style, LV_STATE_DEFAULT, 1);
- lv_style_set_text_line_space(&label_style, LV_STATE_DEFAULT, 1);
-}
-
static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
if (state.label == NULL) {
char text[6] = {};
@@ -70,9 +54,7 @@ ZMK_DISPLAY_WIDGET_LISTENER(widget_layer_status, struct layer_status_state, laye
ZMK_SUBSCRIPTION(widget_layer_status, zmk_layer_state_changed);
int zmk_widget_layer_status_init(struct zmk_widget_layer_status *widget, lv_obj_t *parent) {
- layer_status_init();
widget->obj = lv_label_create(parent, NULL);
- lv_obj_add_style(widget->obj, LV_LABEL_PART_MAIN, &label_style);
lv_obj_set_size(widget->obj, 40, 15);