Remove unecessary validate method call, stylize button properly

This commit is contained in:
Darren Burns
2022-05-11 10:23:51 +01:00
parent b61ee05c98
commit 595b944e0f

View File

@@ -61,7 +61,7 @@ class Button(Widget, can_focus=True):
if label is None:
label = self.css_identifier_styled
self.label: Text = self.validate_label(label)
self.label: Text = label
self.disabled = disabled
if disabled:
@@ -76,7 +76,9 @@ class Button(Widget, can_focus=True):
return label
def render(self, style: Style) -> RenderableType:
return Text.styled(self.label.plain, style)
label = self.label.copy()
label.stylize(style)
return label
async def on_click(self, event: events.Click) -> None:
event.stop()