mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge branch 'css' of github.com:Textualize/textual into text-input
This commit is contained in:
@@ -1,11 +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.renderables.gradient import VerticalGradient
|
||||
from textual import events
|
||||
from textual.widgets import Placeholder
|
||||
from textual.widget import Widget
|
||||
|
||||
lorem = Text.from_markup(
|
||||
@@ -15,12 +13,12 @@ lorem = Text.from_markup(
|
||||
|
||||
|
||||
class Lorem(Widget):
|
||||
def render(self) -> Text:
|
||||
def render(self, style: Style) -> Text:
|
||||
return Padding(lorem, 1)
|
||||
|
||||
|
||||
class Background(Widget):
|
||||
def render(self):
|
||||
def render(self, style: Style):
|
||||
return VerticalGradient("#212121", "#212121")
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,14 @@ from decimal import Decimal
|
||||
from rich.align import Align
|
||||
from rich.console import Console, ConsoleOptions, RenderResult, RenderableType
|
||||
from rich.padding import Padding
|
||||
from rich.style import Style
|
||||
from rich.text import Text
|
||||
|
||||
from textual.app import App
|
||||
from textual.reactive import Reactive
|
||||
from textual.views import GridView
|
||||
from textual.widget import Widget
|
||||
from textual.widgets import Button, ButtonPressed
|
||||
from textual.widgets import Button
|
||||
|
||||
try:
|
||||
from pyfiglet import Figlet
|
||||
@@ -55,7 +56,7 @@ class Numbers(Widget):
|
||||
|
||||
value = Reactive("0")
|
||||
|
||||
def render(self) -> RenderableType:
|
||||
def render(self, style: Style) -> RenderableType:
|
||||
"""Build a Rich renderable to render the calculator display."""
|
||||
return Padding(
|
||||
Align.right(FigletText(self.value), vertical="middle"),
|
||||
|
||||
Reference in New Issue
Block a user