Pass Rich Style object into Textual render method

This commit is contained in:
Darren Burns
2022-05-06 10:20:05 +01:00
parent 6b1dab5387
commit 43f65d73ae
23 changed files with 74 additions and 86 deletions

View File

@@ -1,12 +1,9 @@
from rich.console import Group
from rich.padding import Padding
from rich.style import Style
from rich.text import Text
from textual.app import App
from textual.css.styles import Styles
from textual.renderables.gradient import VerticalGradient
from textual import events
from textual.widgets import Placeholder
from textual.widget import Widget
lorem = Text.from_markup(
@@ -16,12 +13,12 @@ lorem = Text.from_markup(
class Lorem(Widget):
def render(self, styles: Styles) -> Text:
def render(self, style: Style) -> Text:
return Padding(lorem, 1)
class Background(Widget):
def render(self, styles: Styles):
def render(self, style: Style):
return VerticalGradient("#212121", "#212121")