Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions arcade/gui/widgets/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def __init__(

bind(self, "_textures", self.trigger_render)

# prepare label with default style
_style = self.get_current_style()
if _style is None:
raise ValueError(f"No style found for state {self.get_current_state()}")
self._apply_style(_style)

def get_current_state(self) -> str:
"""Returns the current state of the button i.e.disabled, press, hover or normal."""
if self.disabled:
Expand Down Expand Up @@ -330,6 +336,12 @@ def __init__(
**kwargs,
)

# prepare label with default style
_style = self.get_current_style()
if _style is None:
raise ValueError(f"No style found for state {self.get_current_state()}")
self._apply_style(_style)

def get_current_state(self) -> str:
"""Returns the current state of the button i.e.disabled, press, hover or normal."""
if self.disabled:
Expand Down
3 changes: 3 additions & 0 deletions arcade/gui/widgets/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ def update_font(
font_bold = bold if bold is not None else self._label.bold
font_italic = italic if italic is not None else self._label.italic

# ensure type of font_color, label will allways be a color
font_color = Color.from_iterable(font_color)

# Check if values actually changed, if then update and trigger render
font_name_changed = self._label.font_name != font_name
font_size_changed = self._label.font_size != font_size
Expand Down
Loading