mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Replace Static with Label.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Static, Button
|
||||
from textual.widgets import Label, Button
|
||||
|
||||
|
||||
class QuestionApp(App[str]):
|
||||
@@ -7,8 +7,8 @@ class QuestionApp(App[str]):
|
||||
Screen {
|
||||
layout: grid;
|
||||
grid-size: 2;
|
||||
grid-gutter: 2;
|
||||
padding: 2;
|
||||
grid-gutter: 2;
|
||||
padding: 2;
|
||||
}
|
||||
#question {
|
||||
width: 100%;
|
||||
@@ -16,7 +16,7 @@ class QuestionApp(App[str]):
|
||||
column-span: 2;
|
||||
content-align: center bottom;
|
||||
text-style: bold;
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
width: 100%;
|
||||
@@ -24,7 +24,7 @@ class QuestionApp(App[str]):
|
||||
"""
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Static("Do you love Textual?", id="question")
|
||||
yield Label("Do you love Textual?", id="question")
|
||||
yield Button("Yes", id="yes", variant="primary")
|
||||
yield Button("No", id="no", variant="error")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user