docs plugin

This commit is contained in:
Will McGugan
2022-05-23 15:47:55 +01:00
parent 7101b416c7
commit d1235e0d97
21 changed files with 286 additions and 235 deletions

View File

@@ -1,33 +0,0 @@
from rich.panel import Panel
from rich.style import Style
from textual.app import App
from textual.reactive import Reactive
from textual.widget import Widget
class Hover(Widget):
mouse_over = Reactive(False)
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:
self.mouse_over = True
def on_leave(self) -> None:
self.mouse_over = False
class HoverApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self) -> None:
"""Build layout here."""
hovers = (Hover() for _ in range(10))
await self.screen.dock(*hovers, edge="top")
HoverApp.run(log_path="textual.log")

View File

@@ -1,15 +0,0 @@
from textual.app import App
from textual.widgets import Placeholder
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self) -> None:
"""Build layout here."""
await self.screen.dock(Placeholder(), edge="left", size=40)
await self.screen.dock(Placeholder(), Placeholder(), edge="top")
SimpleApp.run(log_path="textual.log")