@@ -64,6 +64,8 @@ MyDesklet.prototype = {
6464 this . settings . bindProperty ( Settings . BindingDirection . IN , "background-color" , "background_color" , this . on_setting_changed ) ;
6565 this . settings . bindProperty ( Settings . BindingDirection . IN , "show-timezone-name" , "show_timezone_name" , this . on_setting_changed ) ;
6666 this . settings . bindProperty ( Settings . BindingDirection . IN , "timezone-name" , "timezone_name" , this . on_setting_changed ) ;
67+ this . settings . bindProperty ( Settings . BindingDirection . IN , "text-font-css" , "text_font_css" , this . on_setting_changed ) ;
68+ this . settings . bindProperty ( Settings . BindingDirection . IN , "label-background-color" , "label_bg_color" , this . on_setting_changed ) ;
6769
6870 // initialize desklet gui
6971 this . setupUI ( ) ;
@@ -191,12 +193,19 @@ MyDesklet.prototype = {
191193
192194 // Add Timezone Name and UTC Offset Label
193195 if ( this . show_timezone_name && this . use_custom_tz ) {
194- let tz_label_text = "UTC " + this . custom_tz + " \n " + this . timezone_name || "" ;
195- let tz_text = new St . Label ( {
196- text : tz_label_text ,
197- style : "text-align: center; margin-top: 5px; font-size: 14px;"
198- } ) ;
199- this . main_container . add_actor ( tz_text ) ;
196+ this . tz_container = new St . Bin ( {
197+ style : `background-color: ${ this . label_bg_color } ; padding: 5px; border-radius: 5px; margin-top: 5px;`
198+ } ) ;
199+ // We create the label and apply the custom font CSS
200+ let tz_label_text = "UTC " + this . custom_tz + " \n " + this . timezone_name || "" ;
201+ this . tz_label = new St . Label ( {
202+ text : tz_label_text , // Text will be set in refresh()
203+ style : `text-align: center; ${ this . text_font_css } `
204+ } ) ;
205+
206+ this . tz_container . set_child ( this . tz_label ) ;
207+ this . main_container . add_actor ( this . tz_container ) ;
208+
200209 }
201210
202211 this . setContent ( this . main_container ) ;
0 commit comments