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,7 +1,7 @@
from rich.panel import Panel
from rich.style import Style
from textual.app import App
from textual.css.styles import Styles
from textual.reactive import Reactive
from textual.widget import Widget
@@ -10,7 +10,7 @@ class Hover(Widget):
mouse_over = Reactive(False)
def render(self, styles: Styles) -> Panel:
def render(self, style: Style) -> Panel:
return Panel("Hello [b]World[/b]", style=("on red" if self.mouse_over else ""))
def on_enter(self) -> None: