Update GUI styling and font configuration
- Fix bt_app.h syntax error (remove stray "1") - Improve menu item alignment and styling - Enable additional LVGL fonts (Montserrat 8, Unscii 16) - Clean up volume page layout, remove instruction labels - Update default font to Montserrat 8 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -81,7 +81,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bt_device_info_t devices[MAX_BT_DEVICES];
|
bt_device_info_t devices[MAX_BT_DEVICES];
|
||||||
int count;1
|
int count;
|
||||||
bool discovery_active;
|
bool discovery_active;
|
||||||
} bt_device_list_t;
|
} bt_device_list_t;
|
||||||
|
|
||||||
|
|||||||
14
main/gui.c
14
main/gui.c
@@ -499,6 +499,7 @@ static lv_obj_t * addMenuItem(lv_obj_t *page, const char *text)
|
|||||||
lv_label_set_text(lbl, text);
|
lv_label_set_text(lbl, text);
|
||||||
lv_obj_set_style_radius(lbl, 0, LV_PART_MAIN | LV_STATE_ANY);
|
lv_obj_set_style_radius(lbl, 0, LV_PART_MAIN | LV_STATE_ANY);
|
||||||
lv_obj_set_style_border_width(lbl, 0, LV_PART_MAIN | LV_STATE_ANY);
|
lv_obj_set_style_border_width(lbl, 0, LV_PART_MAIN | LV_STATE_ANY);
|
||||||
|
lv_obj_align(lbl, LV_ALIGN_LEFT_MID, 0, 0); // Center vertically, align left horizontally
|
||||||
|
|
||||||
// click callback
|
// click callback
|
||||||
lv_obj_add_event_cb(btn, btn_click_cb, LV_EVENT_CLICKED, NULL);
|
lv_obj_add_event_cb(btn, btn_click_cb, LV_EVENT_CLICKED, NULL);
|
||||||
@@ -544,10 +545,12 @@ static void ensure_menu_styles(void) {
|
|||||||
lv_style_init(&_styleUnfocusedBtn);
|
lv_style_init(&_styleUnfocusedBtn);
|
||||||
|
|
||||||
lv_style_set_bg_color(&_styleUnfocusedBtn, lv_color_make(0xff,0xff,0xff)); // white bg
|
lv_style_set_bg_color(&_styleUnfocusedBtn, lv_color_make(0xff,0xff,0xff)); // white bg
|
||||||
lv_style_set_text_color(&_styleUnfocusedBtn, lv_color_black()); // orange text
|
lv_style_set_text_color(&_styleUnfocusedBtn, lv_color_black()); // black text
|
||||||
|
//lv_style_set_text_font(&_styleUnfocusedBtn, &lv_font_unscii_16); // larger font
|
||||||
|
|
||||||
lv_style_set_bg_color(&_styleFocusedBtn, lv_color_make(0x33,0x99,0xFF)); // blue bg
|
lv_style_set_bg_color(&_styleFocusedBtn, lv_color_make(0x33,0x99,0xFF)); // blue bg
|
||||||
lv_style_set_text_color(&_styleFocusedBtn, lv_color_white()); // black text
|
lv_style_set_text_color(&_styleFocusedBtn, lv_color_white()); // white text
|
||||||
|
//lv_style_set_text_font(&_styleFocusedBtn, &lv_font_unscii_16); // larger font
|
||||||
|
|
||||||
styles_initialized = true;
|
styles_initialized = true;
|
||||||
}
|
}
|
||||||
@@ -767,6 +770,8 @@ static lv_obj_t* create_volume_page(void) {
|
|||||||
lv_obj_t* title = lv_label_create(_volume_page);
|
lv_obj_t* title = lv_label_create(_volume_page);
|
||||||
lv_label_set_text(title, "Volume Control");
|
lv_label_set_text(title, "Volume Control");
|
||||||
lv_obj_set_style_text_align(title, LV_TEXT_ALIGN_CENTER, 0);
|
lv_obj_set_style_text_align(title, LV_TEXT_ALIGN_CENTER, 0);
|
||||||
|
lv_obj_set_style_text_color(title, lv_color_black(), 0);
|
||||||
|
//lv_obj_set_style_text_font(title, &lv_font_montserrat_8, 0);
|
||||||
lv_obj_align(title, LV_ALIGN_TOP_MID, 0, 5);
|
lv_obj_align(title, LV_ALIGN_TOP_MID, 0, 5);
|
||||||
|
|
||||||
// Create volume bar (progress bar)
|
// Create volume bar (progress bar)
|
||||||
@@ -783,6 +788,8 @@ static lv_obj_t* create_volume_page(void) {
|
|||||||
lv_label_set_text(_volume_label, volume_text);
|
lv_label_set_text(_volume_label, volume_text);
|
||||||
lv_obj_set_style_text_align(_volume_label, LV_TEXT_ALIGN_CENTER, 0);
|
lv_obj_set_style_text_align(_volume_label, LV_TEXT_ALIGN_CENTER, 0);
|
||||||
lv_obj_align(_volume_label, LV_ALIGN_CENTER, 0, 15);
|
lv_obj_align(_volume_label, LV_ALIGN_CENTER, 0, 15);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
// Create instruction labels
|
// Create instruction labels
|
||||||
lv_obj_t* instr1 = lv_label_create(_volume_page);
|
lv_obj_t* instr1 = lv_label_create(_volume_page);
|
||||||
@@ -794,7 +801,8 @@ static lv_obj_t* create_volume_page(void) {
|
|||||||
lv_label_set_text(instr2, "KEY1: Volume Down");
|
lv_label_set_text(instr2, "KEY1: Volume Down");
|
||||||
lv_obj_set_style_text_align(instr2, LV_TEXT_ALIGN_CENTER, 0);
|
lv_obj_set_style_text_align(instr2, LV_TEXT_ALIGN_CENTER, 0);
|
||||||
lv_obj_align(instr2, LV_ALIGN_BOTTOM_MID, 0, -10);
|
lv_obj_align(instr2, LV_ALIGN_BOTTOM_MID, 0, -10);
|
||||||
|
#endif
|
||||||
|
|
||||||
return _volume_page;
|
return _volume_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -481,7 +481,7 @@
|
|||||||
|
|
||||||
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
|
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
|
||||||
*https://fonts.google.com/specimen/Montserrat*/
|
*https://fonts.google.com/specimen/Montserrat*/
|
||||||
#define LV_FONT_MONTSERRAT_8 0
|
#define LV_FONT_MONTSERRAT_8 1
|
||||||
#define LV_FONT_MONTSERRAT_10 0
|
#define LV_FONT_MONTSERRAT_10 0
|
||||||
#define LV_FONT_MONTSERRAT_12 0
|
#define LV_FONT_MONTSERRAT_12 0
|
||||||
#define LV_FONT_MONTSERRAT_14 1
|
#define LV_FONT_MONTSERRAT_14 1
|
||||||
@@ -511,7 +511,7 @@
|
|||||||
|
|
||||||
/*Pixel perfect monospace fonts*/
|
/*Pixel perfect monospace fonts*/
|
||||||
#define LV_FONT_UNSCII_8 0
|
#define LV_FONT_UNSCII_8 0
|
||||||
#define LV_FONT_UNSCII_16 0
|
#define LV_FONT_UNSCII_16 1
|
||||||
|
|
||||||
/*Optionally declare custom fonts here.
|
/*Optionally declare custom fonts here.
|
||||||
*You can use these fonts as default font too and they will be available globally.
|
*You can use these fonts as default font too and they will be available globally.
|
||||||
@@ -519,7 +519,7 @@
|
|||||||
#define LV_FONT_CUSTOM_DECLARE
|
#define LV_FONT_CUSTOM_DECLARE
|
||||||
|
|
||||||
/*Always set a default font*/
|
/*Always set a default font*/
|
||||||
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
#define LV_FONT_DEFAULT &lv_font_unscii_16
|
||||||
|
|
||||||
/*Enable handling large font and/or fonts with a lot of characters.
|
/*Enable handling large font and/or fonts with a lot of characters.
|
||||||
*The limit depends on the font size, font face and bpp.
|
*The limit depends on the font size, font face and bpp.
|
||||||
|
|||||||
12
sdkconfig
12
sdkconfig
@@ -2246,13 +2246,13 @@ CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE=1
|
|||||||
#
|
#
|
||||||
# Enable built-in fonts
|
# Enable built-in fonts
|
||||||
#
|
#
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_8 is not set
|
CONFIG_LV_FONT_MONTSERRAT_8=y
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_10 is not set
|
# CONFIG_LV_FONT_MONTSERRAT_10 is not set
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_12 is not set
|
CONFIG_LV_FONT_MONTSERRAT_12=y
|
||||||
CONFIG_LV_FONT_MONTSERRAT_14=y
|
CONFIG_LV_FONT_MONTSERRAT_14=y
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_16 is not set
|
# CONFIG_LV_FONT_MONTSERRAT_16 is not set
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_18 is not set
|
# CONFIG_LV_FONT_MONTSERRAT_18 is not set
|
||||||
CONFIG_LV_FONT_MONTSERRAT_20=y
|
# CONFIG_LV_FONT_MONTSERRAT_20 is not set
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_22 is not set
|
# CONFIG_LV_FONT_MONTSERRAT_22 is not set
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_24 is not set
|
# CONFIG_LV_FONT_MONTSERRAT_24 is not set
|
||||||
# CONFIG_LV_FONT_MONTSERRAT_26 is not set
|
# CONFIG_LV_FONT_MONTSERRAT_26 is not set
|
||||||
@@ -2272,10 +2272,10 @@ CONFIG_LV_FONT_MONTSERRAT_20=y
|
|||||||
# CONFIG_LV_FONT_SIMSUN_14_CJK is not set
|
# CONFIG_LV_FONT_SIMSUN_14_CJK is not set
|
||||||
# CONFIG_LV_FONT_SIMSUN_16_CJK is not set
|
# CONFIG_LV_FONT_SIMSUN_16_CJK is not set
|
||||||
CONFIG_LV_FONT_UNSCII_8=y
|
CONFIG_LV_FONT_UNSCII_8=y
|
||||||
# CONFIG_LV_FONT_UNSCII_16 is not set
|
CONFIG_LV_FONT_UNSCII_16=y
|
||||||
# end of Enable built-in fonts
|
# end of Enable built-in fonts
|
||||||
|
|
||||||
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_8 is not set
|
CONFIG_LV_FONT_DEFAULT_MONTSERRAT_8=y
|
||||||
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_10 is not set
|
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_10 is not set
|
||||||
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12 is not set
|
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12 is not set
|
||||||
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_14 is not set
|
# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_14 is not set
|
||||||
@@ -2300,7 +2300,7 @@ CONFIG_LV_FONT_UNSCII_8=y
|
|||||||
# CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW is not set
|
# CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW is not set
|
||||||
# CONFIG_LV_FONT_DEFAULT_SIMSUN_14_CJK is not set
|
# CONFIG_LV_FONT_DEFAULT_SIMSUN_14_CJK is not set
|
||||||
# CONFIG_LV_FONT_DEFAULT_SIMSUN_16_CJK is not set
|
# CONFIG_LV_FONT_DEFAULT_SIMSUN_16_CJK is not set
|
||||||
CONFIG_LV_FONT_DEFAULT_UNSCII_8=y
|
# CONFIG_LV_FONT_DEFAULT_UNSCII_8 is not set
|
||||||
# CONFIG_LV_FONT_DEFAULT_UNSCII_16 is not set
|
# CONFIG_LV_FONT_DEFAULT_UNSCII_16 is not set
|
||||||
# CONFIG_LV_FONT_FMT_TXT_LARGE is not set
|
# CONFIG_LV_FONT_FMT_TXT_LARGE is not set
|
||||||
# CONFIG_LV_USE_FONT_COMPRESSED is not set
|
# CONFIG_LV_USE_FONT_COMPRESSED is not set
|
||||||
|
|||||||
Reference in New Issue
Block a user