Background Color

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Background Color

Jump to solution
4,267 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
4,243 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
4,091 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
4,073 Views
Jeannot
Contributor II

Thanks so much!

0 Kudos
4,248 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
4,244 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

4,226 Views
Jeannot
Contributor II

Thank you!

0 Kudos
4,260 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