Shorten layout names

This commit is contained in:
Johannes Marbach 2021-09-09 13:13:43 +02:00
parent be7215134e
commit 809c8af73b
3 changed files with 9 additions and 9 deletions

View file

@ -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 { \

8
main.c
View file

@ -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);

View file

@ -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]} */')