Background Color

cancel
Showing results for 
Search instead for 
Did you mean: 

Background Color

Jump to solution
869 Views
Jeannot
Contributor II

Gui Guider Version: 1.2.1-GA // Windows 10

I'm able to edit the source code to a given background color via "lv_obj_set_style_local_bg_color", but I can't in the application itself. How do I edit the background color in Gui Guider? I don't see a widget or setting to address this in the application. 

0 Kudos
1 Solution
845 Views
zhenhualuo
NXP Employee
NXP Employee

Hi,

The background of screen can't be set by GUI Guider, we will add the function in next release (v1.3.0). Currently you can manually add the code in custom.c of application to change screen background, you can also use container or image widget to implement the effect in the UI editor.

 

Best Regards,

Zhenhua

View solution in original post

6 Replies
693 Views
gertvb
Contributor III

Good day!

Im still working with GUIGuider1.1 and used the following approach to set the screen's background

Ive created a new style, set its background, and added the style to the screen defined by GUIGuider.

Attached the code as in the screen definition file created by GUIGuider.

void setup_scr_scr_info(lv_ui *ui){

//Write codes scr_info
ui->scr_info = lv_obj_create(NULL, NULL);

//GvB added to set screen background to dark green : begin.....
static lv_style_t style_scr_info;
lv_style_set_bg_color(&style_scr_info, LV_STATE_DEFAULT, lv_color_hex(0x008800));
lv_obj_add_style(ui->scr_info, LV_OBJ_PART_MAIN, &style_scr_info);

//GvB added to set screen background end.....

//Write codes scr_info_btn_Settings
ui->scr_info_btn_Settings = lv_btn_create(ui->scr_info, NULL);

//Write style LV_BTN_PART_MAIN for scr_info_btn_Settings
static lv_style_t style_scr_info_btn_Settings_main;
lv_style_init(&style_scr_info_btn_Settings_main);

 

A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy
675 Views
Jeannot
Contributor II

Thanks so much!

0 Kudos
850 Views
Jeannot
Contributor II

I'm not talking about the widgets themselves, that's clear. What I'm after is a global color setting for the screen background itself. This is a line in the source code, see reference above. By default it's transparent in Guider, and can only be changed with code and seen via simulator or hardware. 

0 Kudos
846 Views
zhenhualuo
NXP Employee
NXP Employee

Hi,

The background of screen can't be set by GUI Guider, we will add the function in next release (v1.3.0). Currently you can manually add the code in custom.c of application to change screen background, you can also use container or image widget to implement the effect in the UI editor.

 

Best Regards,

Zhenhua

View solution in original post

828 Views
Jeannot
Contributor II

Thank you!

0 Kudos
862 Views
zhenhualuo
NXP Employee
NXP Employee

Hi, 

The background color can be configured in GUI Guider, you will see the background setting when a widget is selected in the UI editor.  

zhenhualuo_0-1633663858974.png

 

Best Regards,

Zhenhua 

0 Kudos