Add style param to Widget render method

This commit is contained in:
Darren Burns
2022-05-05 16:06:49 +01:00
parent b2553b34b2
commit e473e4873a
21 changed files with 56 additions and 47 deletions

View File

@@ -53,12 +53,12 @@ lorem = Text.from_markup(
class TweetHeader(Widget):
def render(self) -> RenderableType:
def render(self, styles: Styles) -> RenderableType:
return Text("Lorem Impsum", justify="center")
class TweetBody(Widget):
def render(self) -> Text:
def render(self, styles: Styles) -> Text:
return lorem
@@ -67,22 +67,22 @@ class Tweet(Widget):
class OptionItem(Widget):
def render(self) -> Text:
def render(self, styles: Styles) -> Text:
return Text("Option")
class Error(Widget):
def render(self) -> Text:
def render(self, styles: Styles) -> Text:
return Text("This is an error message", justify="center")
class Warning(Widget):
def render(self) -> Text:
def render(self, styles: Styles) -> Text:
return Text("This is a warning message", justify="center")
class Success(Widget):
def render(self) -> Text:
def render(self, styles: Styles) -> Text:
return Text("This is a success message", justify="center")