Skip to content

Commit

Permalink
Change pressed state colors of buttons, fixed cut of button overflow …
Browse files Browse the repository at this point in the history
…when pressed, improved about screen
  • Loading branch information
unic8s committed Dec 28, 2024
1 parent 39aade4 commit 5478eba
Show file tree
Hide file tree
Showing 10 changed files with 276 additions and 176 deletions.
6 changes: 3 additions & 3 deletions squareline/SquareLine_Project.sll

Large diffs are not rendered by default.

383 changes: 228 additions & 155 deletions squareline/SquareLine_Project.spj

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ SET(SOURCES screens/ui_Intro.c
images/ui_img_165882922.c
images/ui_img_1132554101.c
images/ui_img_qrcode_png.c
images/ui_img_2124055880.c
images/ui_img_sg_1202_png.c
images/ui_img_sg_3802_png.c
images/ui_img_sg_ac2_png.c
Expand Down
1 change: 0 additions & 1 deletion src/ui/filelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ images/ui_img_1566825004.c
images/ui_img_165882922.c
images/ui_img_1132554101.c
images/ui_img_qrcode_png.c
images/ui_img_2124055880.c
images/ui_img_sg_1202_png.c
images/ui_img_sg_3802_png.c
images/ui_img_sg_ac2_png.c
Expand Down
18 changes: 6 additions & 12 deletions src/ui/screens/ui_About.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,16 @@ void ui_About_screen_init(void)
lv_obj_set_style_text_font(ui_LblVersion, &lv_font_montserrat_28, LV_PART_MAIN | LV_STATE_DEFAULT);

ui_Label8 = lv_label_create(ui_Container14);
lv_obj_set_width(ui_Label8, lv_pct(68));
lv_obj_set_width(ui_Label8, lv_pct(100));
lv_obj_set_height(ui_Label8, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_Label8, -130);
lv_obj_set_y(ui_Label8, -15);
lv_obj_set_align(ui_Label8, LV_ALIGN_CENTER);
lv_label_set_text(ui_Label8,
"Copyright (C) 2024 All rights reserved.\n\nThis software is released under the Creative Commons Attribution-NonCommercial 4.0 International Public License.\n\nFor any further information please visit:\ngithub.com/unic8s/hd2_macropad");
"Copyright (C) 2024 All rights reserved.\nThis software is released under the Creative Commons Attribution-NonCommercial 4.0 International Public License.\n\nFor any further information please visit:\ngithub.com/unic8s/hd2_macropad\n\nA project by\nOliver G. @Gore66\nErik L. @unic8s");
lv_obj_set_style_text_letter_space(ui_Label8, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui_Label8, 4, LV_PART_MAIN | LV_STATE_DEFAULT);

ui_Label9 = lv_label_create(ui_Container14);
lv_obj_set_width(ui_Label9, lv_pct(30));
lv_obj_set_height(ui_Label9, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_Label9, 168);
lv_obj_set_y(ui_Label9, -78);
lv_obj_set_align(ui_Label9, LV_ALIGN_CENTER);
lv_label_set_text(ui_Label9, "A project by\nOliver G. @Gore66\nErik L. @unic8s");
lv_obj_set_style_text_letter_space(ui_Label9, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui_Label9, 4, LV_PART_MAIN | LV_STATE_DEFAULT);

ui_Image1 = lv_img_create(ui_About);
lv_img_set_src(ui_Image1, &ui_img_qrcode_png);
lv_obj_set_width(ui_Image1, LV_SIZE_CONTENT); /// 1
Expand All @@ -101,6 +91,10 @@ void ui_About_screen_init(void)
ui_object_set_themeable_style_property(ui_Button10, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_Button10, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_Button10, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_Button10, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

lv_obj_add_event_cb(ui_Button10, ui_event_Button10, LV_EVENT_ALL, NULL);
uic_Button10 = ui_Button10;
Expand Down
21 changes: 21 additions & 0 deletions src/ui/screens/ui_Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ void ui_Config_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnTest, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnTest, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnTest, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnTest, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_LblTest = lv_label_create(ui_BtnTest);
lv_obj_set_width(ui_LblTest, LV_SIZE_CONTENT); /// 1
Expand Down Expand Up @@ -404,6 +408,7 @@ void ui_Config_screen_init(void)
lv_obj_set_align(ui_SetupFooter2, LV_ALIGN_BOTTOM_MID);
lv_obj_set_flex_flow(ui_SetupFooter2, LV_FLEX_FLOW_ROW);
lv_obj_set_flex_align(ui_SetupFooter2, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
lv_obj_add_flag(ui_SetupFooter2, LV_OBJ_FLAG_OVERFLOW_VISIBLE); /// Flags
lv_obj_clear_flag(ui_SetupFooter2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_pad_left(ui_SetupFooter2, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui_SetupFooter2, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
Expand All @@ -428,6 +433,10 @@ void ui_Config_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnSetup, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnSetup, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnSetup, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnSetup, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_BtnAbout = lv_btn_create(ui_SetupFooter2);
lv_obj_set_width(ui_BtnAbout, 76);
Expand All @@ -445,6 +454,10 @@ void ui_Config_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnAbout, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnAbout, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnAbout, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnAbout, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_Container11 = lv_obj_create(ui_SetupFooter2);
lv_obj_remove_style_all(ui_Container11);
Expand All @@ -469,6 +482,10 @@ void ui_Config_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnDefault, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnDefault, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnDefault, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnDefault, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_BtnReboot = lv_btn_create(ui_SetupFooter2);
lv_obj_set_width(ui_BtnReboot, 76);
Expand All @@ -486,6 +503,10 @@ void ui_Config_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnReboot, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnReboot, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnReboot, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnReboot, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

lv_obj_add_event_cb(ui_SldBrightness, ui_event_SldBrightness, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_ChbFlip, ui_event_ChbFlip, LV_EVENT_ALL, NULL);
Expand Down
4 changes: 4 additions & 0 deletions src/ui/screens/ui_Game.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ void ui_Game_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnBack, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnBack, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnBack, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnBack, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_CntBT = lv_obj_create(ui_Game);
lv_obj_remove_style_all(ui_CntBT);
Expand Down
13 changes: 13 additions & 0 deletions src/ui/screens/ui_Setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,7 @@ void ui_Setup_screen_init(void)
lv_obj_set_align(ui_SetupFooter, LV_ALIGN_BOTTOM_MID);
lv_obj_set_flex_flow(ui_SetupFooter, LV_FLEX_FLOW_ROW);
lv_obj_set_flex_align(ui_SetupFooter, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
lv_obj_add_flag(ui_SetupFooter, LV_OBJ_FLAG_OVERFLOW_VISIBLE); /// Flags
lv_obj_clear_flag(ui_SetupFooter, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_pad_row(ui_SetupFooter, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_column(ui_SetupFooter, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
Expand All @@ -1519,6 +1520,10 @@ void ui_Setup_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnConfig, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnConfig, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnConfig, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnConfig, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_BtnReset = lv_btn_create(ui_SetupFooter);
lv_obj_set_width(ui_BtnReset, 76);
Expand All @@ -1536,6 +1541,10 @@ void ui_Setup_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnReset, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnReset, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnReset, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnReset, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

ui_BarAmount = lv_bar_create(ui_SetupFooter);
lv_bar_set_range(ui_BarAmount, 0, 4);
Expand Down Expand Up @@ -1583,6 +1592,10 @@ void ui_Setup_screen_init(void)
ui_object_set_themeable_style_property(ui_BtnPlay, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorTheme);
lv_obj_set_style_border_width(ui_BtnPlay, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_BtnPlay, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_COLOR,
_ui_theme_color_colorActive);
ui_object_set_themeable_style_property(ui_BtnPlay, LV_PART_MAIN | LV_STATE_PRESSED, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_colorActive);

lv_obj_add_event_cb(ui_WeaponsMG, ui_event_WeaponsMG, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_WeaponsHMG, ui_event_WeaponsHMG, LV_EVENT_ALL, NULL);
Expand Down
3 changes: 1 addition & 2 deletions src/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ lv_obj_t * ui_Container14;
lv_obj_t * ui_Label7;
lv_obj_t * ui_LblVersion;
lv_obj_t * ui_Label8;
lv_obj_t * ui_Label9;
lv_obj_t * ui_Image1;
void ui_event_Button10(lv_event_t * e);
lv_obj_t * ui_Button10;
Expand All @@ -267,7 +266,7 @@ lv_obj_t * ui____initial_actions0;
const lv_img_dsc_t * ui_imgset_792859353[1] = {&ui_img_1566825004};
const lv_img_dsc_t * ui_imgset_1388782467[1] = {&ui_img_1050696822};
const lv_img_dsc_t * ui_imgset_1570572463[1] = {&ui_img_738976508};
const lv_img_dsc_t * ui_imgset_313891012[2] = {&ui_img_2124055880, &ui_img_2089845529};
const lv_img_dsc_t * ui_imgset_313891012[1] = {&ui_img_2089845529};
const lv_img_dsc_t * ui_imgset_2008775657[1] = {&ui_img_165882922};
const lv_img_dsc_t * ui_imgset_1732230296[1] = {&ui_img_1132554101};
const lv_img_dsc_t * ui_imgset_895911889[1] = {&ui_img_619782496};
Expand Down
2 changes: 0 additions & 2 deletions src/ui/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ extern lv_obj_t * ui_Container14;
extern lv_obj_t * ui_Label7;
extern lv_obj_t * ui_LblVersion;
extern lv_obj_t * ui_Label8;
extern lv_obj_t * ui_Label9;
extern lv_obj_t * ui_Image1;
void ui_event_Button10(lv_event_t * e);
extern lv_obj_t * ui_Button10;
Expand Down Expand Up @@ -356,7 +355,6 @@ LV_IMG_DECLARE(ui_img_1566825004); // assets/icons/icons8-about-32.png
LV_IMG_DECLARE(ui_img_165882922); // assets/icons/icons8-reset-32.png
LV_IMG_DECLARE(ui_img_1132554101); // assets/icons/icons8-shutdown-32.png
LV_IMG_DECLARE(ui_img_qrcode_png); // assets/qrcode.png
LV_IMG_DECLARE(ui_img_2124055880); // assets/icons/icons8-play-26.png
LV_IMG_DECLARE(ui_img_sg_1202_png); // assets/sg/1202.png
LV_IMG_DECLARE(ui_img_sg_3802_png); // assets/sg/3802.png
LV_IMG_DECLARE(ui_img_sg_ac2_png); // assets/sg/AC2.png
Expand Down

0 comments on commit 5478eba

Please sign in to comment.