File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,12 @@ def __init__(
140140
141141 bind (self , "_textures" , self .trigger_render )
142142
143+ # prepare label with default style
144+ _style = self .get_current_style ()
145+ if _style is None :
146+ raise ValueError (f"No style found for state { self .get_current_state ()} " )
147+ self ._apply_style (_style )
148+
143149 def get_current_state (self ) -> str :
144150 """Returns the current state of the button i.e.disabled, press, hover or normal."""
145151 if self .disabled :
@@ -330,6 +336,12 @@ def __init__(
330336 ** kwargs ,
331337 )
332338
339+ # prepare label with default style
340+ _style = self .get_current_style ()
341+ if _style is None :
342+ raise ValueError (f"No style found for state { self .get_current_state ()} " )
343+ self ._apply_style (_style )
344+
333345 def get_current_state (self ) -> str :
334346 """Returns the current state of the button i.e.disabled, press, hover or normal."""
335347 if self .disabled :
Original file line number Diff line number Diff line change @@ -273,6 +273,9 @@ def update_font(
273273 font_bold = bold if bold is not None else self ._label .bold
274274 font_italic = italic if italic is not None else self ._label .italic
275275
276+ # ensure type of font_color, label will allways be a color
277+ font_color = Color .from_iterable (font_color )
278+
276279 # Check if values actually changed, if then update and trigger render
277280 font_name_changed = self ._label .font_name != font_name
278281 font_size_changed = self ._label .font_size != font_size
You can’t perform that action at this time.
0 commit comments