From 1311719b6d182303321c513d95726741b8dcba18 Mon Sep 17 00:00:00 2001 From: KlausMu Date: Tue, 23 Jan 2024 07:59:06 +0100 Subject: [PATCH] removed numbering of tab variables. not needed anymore --- Platformio/src/gui_appleTV.cpp | 8 ++++---- Platformio/src/gui_numpad.cpp | 8 ++++---- Platformio/src/gui_settings.cpp | 20 ++++++++++---------- Platformio/src/gui_smarthome.cpp | 18 +++++++++--------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Platformio/src/gui_appleTV.cpp b/Platformio/src/gui_appleTV.cpp index 5484509..387e014 100644 --- a/Platformio/src/gui_appleTV.cpp +++ b/Platformio/src/gui_appleTV.cpp @@ -18,15 +18,15 @@ static void appleKey_event_cb(lv_event_t* e) { void init_gui_appleTV(lv_obj_t* tabview) { - lv_obj_t* tab3 = lv_tabview_add_tab(tabview, "Apple TV"); + lv_obj_t* tab = lv_tabview_add_tab(tabview, "Apple TV"); // Add content to the Apple TV tab (3) // Add a nice apple tv logo - lv_obj_t* appleImg = lv_img_create(tab3); + lv_obj_t* appleImg = lv_img_create(tab); lv_img_set_src(appleImg, &appleTvIcon); lv_obj_align(appleImg, LV_ALIGN_CENTER, 0, -60); // create two buttons and add their icons accordingly - lv_obj_t* button = lv_btn_create(tab3); + lv_obj_t* button = lv_btn_create(tab); lv_obj_align(button, LV_ALIGN_BOTTOM_LEFT, 10, 0); lv_obj_set_size(button, 60, 60); lv_obj_set_style_radius(button, 30, LV_PART_MAIN); @@ -39,7 +39,7 @@ void init_gui_appleTV(lv_obj_t* tabview) { lv_obj_set_style_img_recolor_opa(appleImg, LV_OPA_COVER, LV_PART_MAIN); lv_obj_align(appleImg, LV_ALIGN_CENTER, -3, 0); - button = lv_btn_create(tab3); + button = lv_btn_create(tab); lv_obj_align(button, LV_ALIGN_BOTTOM_RIGHT, -10, 0); lv_obj_set_size(button, 60, 60); lv_obj_set_style_radius(button, 30, LV_PART_MAIN); diff --git a/Platformio/src/gui_numpad.cpp b/Platformio/src/gui_numpad.cpp index edc2c05..d341388 100644 --- a/Platformio/src/gui_numpad.cpp +++ b/Platformio/src/gui_numpad.cpp @@ -20,15 +20,15 @@ static void virtualKeypad_event_cb(lv_event_t* e) { void init_gui_numpad(lv_obj_t* tabview) { - lv_obj_t* tab2 = lv_tabview_add_tab(tabview, "Numpad"); + lv_obj_t* tab = lv_tabview_add_tab(tabview, "Numpad"); // Configure number button grid static lv_coord_t col_dsc[] = { LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST }; // equal x distribution static lv_coord_t row_dsc[] = { 52, 52, 52, 52, LV_GRID_TEMPLATE_LAST }; // manual y distribution to compress the grid a bit - // Create a container with grid for tab2 - lv_obj_set_style_pad_all(tab2, 0, LV_PART_MAIN); - lv_obj_t* cont = lv_obj_create(tab2); + // Create a container with grid for tab + lv_obj_set_style_pad_all(tab, 0, LV_PART_MAIN); + lv_obj_t* cont = lv_obj_create(tab); lv_obj_set_style_shadow_width(cont, 0, LV_PART_MAIN); lv_obj_set_style_bg_color(cont, lv_color_black(), LV_PART_MAIN); lv_obj_set_style_border_width(cont, 0, LV_PART_MAIN); diff --git a/Platformio/src/gui_settings.cpp b/Platformio/src/gui_settings.cpp index 56130be..32a91a2 100644 --- a/Platformio/src/gui_settings.cpp +++ b/Platformio/src/gui_settings.cpp @@ -21,20 +21,20 @@ static void WakeEnableSetting_event_cb(lv_event_t * e){ void init_gui_settings(lv_obj_t* tabview) { - lv_obj_t* tab1 = lv_tabview_add_tab(tabview, "Settings"); + lv_obj_t* tab = lv_tabview_add_tab(tabview, "Settings"); // Add content to the settings tab // With a flex layout, setting groups/boxes will position themselves automatically - lv_obj_set_layout(tab1, LV_LAYOUT_FLEX); - lv_obj_set_flex_flow(tab1, LV_FLEX_FLOW_COLUMN); - lv_obj_set_scrollbar_mode(tab1, LV_SCROLLBAR_MODE_ACTIVE); + lv_obj_set_layout(tab, LV_LAYOUT_FLEX); + lv_obj_set_flex_flow(tab, LV_FLEX_FLOW_COLUMN); + lv_obj_set_scrollbar_mode(tab, LV_SCROLLBAR_MODE_ACTIVE); // Add a label, then a box for the display settings - lv_obj_t* menuLabel = lv_label_create(tab1); + lv_obj_t* menuLabel = lv_label_create(tab); lv_label_set_text(menuLabel, "Display"); - lv_obj_t* menuBox = lv_obj_create(tab1); + lv_obj_t* menuBox = lv_obj_create(tab); lv_obj_set_size(menuBox, lv_pct(100), 77); // 109, 32 weniger wegen fehlendem Timeout lv_obj_set_style_bg_color(menuBox, color_primary, LV_PART_MAIN); lv_obj_set_style_border_width(menuBox, 0, LV_PART_MAIN); @@ -88,9 +88,9 @@ void init_gui_settings(lv_obj_t* tabview) { // lv_obj_set_style_border_color(lv_dropdown_get_list(drop), lv_color_hex(0x505050), LV_PART_MAIN); // // Add another label, then a settings box for WiFi - // menuLabel = lv_label_create(tab1); + // menuLabel = lv_label_create(tab); // lv_label_set_text(menuLabel, "Wi-Fi"); - // menuBox = lv_obj_create(tab1); + // menuBox = lv_obj_create(tab); // lv_obj_set_size(menuBox, lv_pct(100), 80); // lv_obj_set_style_bg_color(menuBox, color_primary, LV_PART_MAIN); // lv_obj_set_style_border_width(menuBox, 0, LV_PART_MAIN); @@ -107,9 +107,9 @@ void init_gui_settings(lv_obj_t* tabview) { // lv_obj_align(menuLabel, LV_ALIGN_TOP_RIGHT, 0, 32); // Another setting for the battery - menuLabel = lv_label_create(tab1); + menuLabel = lv_label_create(tab); lv_label_set_text(menuLabel, "Battery"); - menuBox = lv_obj_create(tab1); + menuBox = lv_obj_create(tab); lv_obj_set_size(menuBox, lv_pct(100), 77); // 125 lv_obj_set_style_bg_color(menuBox, color_primary, LV_PART_MAIN); lv_obj_set_style_border_width(menuBox, 0, LV_PART_MAIN); diff --git a/Platformio/src/gui_smarthome.cpp b/Platformio/src/gui_smarthome.cpp index cb24809..97390b9 100644 --- a/Platformio/src/gui_smarthome.cpp +++ b/Platformio/src/gui_smarthome.cpp @@ -34,18 +34,18 @@ static void smartHomeSlider_event_cb(lv_event_t * e){ void init_gui_smarthome(lv_obj_t* tabview) { - lv_obj_t* tab4 = lv_tabview_add_tab(tabview, "Smart Home"); + lv_obj_t* tab = lv_tabview_add_tab(tabview, "Smart Home"); // Add content to the smart home tab (4) - lv_obj_set_layout(tab4, LV_LAYOUT_FLEX); - lv_obj_set_flex_flow(tab4, LV_FLEX_FLOW_COLUMN); - lv_obj_set_scrollbar_mode(tab4, LV_SCROLLBAR_MODE_ACTIVE); + lv_obj_set_layout(tab, LV_LAYOUT_FLEX); + lv_obj_set_flex_flow(tab, LV_FLEX_FLOW_COLUMN); + lv_obj_set_scrollbar_mode(tab, LV_SCROLLBAR_MODE_ACTIVE); // Add a label, then a box for the light controls - lv_obj_t* menuLabel = lv_label_create(tab4); + lv_obj_t* menuLabel = lv_label_create(tab); lv_label_set_text(menuLabel, "Living Room"); - lv_obj_t* menuBox = lv_obj_create(tab4); + lv_obj_t* menuBox = lv_obj_create(tab); lv_obj_set_size(menuBox, lv_pct(100), 79); lv_obj_set_style_bg_color(menuBox, color_primary, LV_PART_MAIN); lv_obj_set_style_border_width(menuBox, 0, LV_PART_MAIN); @@ -80,7 +80,7 @@ void init_gui_smarthome(lv_obj_t* tabview) { lv_obj_add_event_cb(slider, smartHomeSlider_event_cb, LV_EVENT_VALUE_CHANGED, (void*)1); // Add another menu box for a second appliance - menuBox = lv_obj_create(tab4); + menuBox = lv_obj_create(tab); lv_obj_set_size(menuBox, lv_pct(100), 79); lv_obj_set_style_bg_color(menuBox, color_primary, LV_PART_MAIN); lv_obj_set_style_border_width(menuBox, 0, LV_PART_MAIN); @@ -116,10 +116,10 @@ void init_gui_smarthome(lv_obj_t* tabview) { // Add another room (empty for now) - menuLabel = lv_label_create(tab4); + menuLabel = lv_label_create(tab); lv_label_set_text(menuLabel, "Kitchen"); - menuBox = lv_obj_create(tab4); + menuBox = lv_obj_create(tab); lv_obj_set_size(menuBox, lv_pct(100), 79); lv_obj_set_style_bg_color(menuBox, color_primary, LV_PART_MAIN); lv_obj_set_style_border_width(menuBox, 0, LV_PART_MAIN);