From 809c8af73bcbcb5ecd66a05f29322b5fc6f91cef Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 9 Sep 2021 13:13:43 +0200 Subject: [PATCH] Shorten layout names --- layouts.c | 8 ++++---- main.c | 8 ++++---- unsqu33kr/unsqu33kr.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/layouts.c b/layouts.c index 9d6b3c9..0684bd1 100644 --- a/layouts.c +++ b/layouts.c @@ -4,7 +4,7 @@ * English (US) **/ -#define NAME_US "English (US)" +#define NAME_US "us" /* Lowercase layer */ #define KEYS_LOWER_US { \ @@ -57,7 +57,7 @@ * French **/ -#define NAME_FR "French" +#define NAME_FR "fr" /* Lowercase layer */ #define KEYS_LOWER_FR { \ @@ -120,7 +120,7 @@ * Spanish **/ -#define NAME_ES "Spanish" +#define NAME_ES "es" /* Lowercase layer */ #define KEYS_LOWER_ES { \ @@ -183,7 +183,7 @@ * German **/ -#define NAME_DE "German" +#define NAME_DE "de" /* Lowercase layer */ #define KEYS_LOWER_DE { \ diff --git a/main.c b/main.c index 356cfd0..2e23fe4 100644 --- a/main.c +++ b/main.c @@ -440,7 +440,7 @@ int main(void) lv_obj_add_event_cb(keyboard, keyboard_event_ready_cb, LV_EVENT_READY, NULL); // Button row - static lv_coord_t btn_row_col_dsc[] = { 64, 64, 300, LV_GRID_FR(1), 64, LV_GRID_TEMPLATE_LAST }; + static lv_coord_t btn_row_col_dsc[] = { 64, 64, LV_GRID_FR(1), 64, LV_GRID_TEMPLATE_LAST }; static lv_coord_t btn_row_row_dsc[] = { 64, LV_GRID_TEMPLATE_LAST }; lv_obj_t *btn_row = lv_obj_create(lv_scr_act()); lv_obj_set_size(btn_row, LV_PCT(100), LV_SIZE_CONTENT); @@ -473,15 +473,15 @@ int main(void) lv_obj_t *dropdown = lv_dropdown_create(btn_row); lv_dropdown_set_options(dropdown, get_layout_names()); lv_obj_set_height(dropdown, 64); - lv_obj_set_width(dropdown, 300); - lv_obj_set_grid_cell(dropdown, LV_GRID_ALIGN_CENTER, 2, 1, LV_GRID_ALIGN_CENTER, 0, 1); + lv_obj_set_width(dropdown, 160); + lv_obj_set_grid_cell(dropdown, LV_GRID_ALIGN_START, 2, 1, LV_GRID_ALIGN_CENTER, 0, 1); lv_obj_add_style(dropdown, &style_text_normal, 0); lv_obj_add_event_cb(dropdown, keymap_dropdown_event_cb, LV_EVENT_ALL, NULL); // Power button lv_obj_t *power_btn = lv_btn_create(btn_row); lv_obj_set_size(power_btn, 64, 64); - lv_obj_set_grid_cell(power_btn, LV_GRID_ALIGN_CENTER, 4, 1, LV_GRID_ALIGN_CENTER, 0, 1); + lv_obj_set_grid_cell(power_btn, LV_GRID_ALIGN_CENTER, 3, 1, LV_GRID_ALIGN_CENTER, 0, 1); lv_obj_t *power_btn_label = lv_label_create(power_btn); lv_obj_add_style(power_btn_label, &style_text_normal, 0); lv_obj_center(power_btn_label); diff --git a/unsqu33kr/unsqu33kr.py b/unsqu33kr/unsqu33kr.py index d8020c3..59761d1 100644 --- a/unsqu33kr/unsqu33kr.py +++ b/unsqu33kr/unsqu33kr.py @@ -116,7 +116,7 @@ if __name__ == '__main__': buttons = data['buttons'] if 'buttons' in data else {} print(f'/**\n * {name_map[name]}\n **/\n') - print(f'#define NAME_{name.upper()} "{name_map[name]}"\n') + print(f'#define NAME_{name.upper()} "{name}"\n') for layer in layer_whitelist: print(f'/* {layer_to_description[layer]} */')