mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update base scrollbar example.
This commit is contained in:
@@ -1,23 +1,14 @@
|
||||
Screen {
|
||||
background: #212121;
|
||||
color: white 80%;
|
||||
layout: horizontal;
|
||||
Label {
|
||||
width: 150%;
|
||||
height: 150%;
|
||||
}
|
||||
|
||||
Static {
|
||||
padding: 1 2;
|
||||
}
|
||||
|
||||
.panel1 {
|
||||
width: 1fr;
|
||||
.right {
|
||||
scrollbar-background: red;
|
||||
scrollbar-color: green;
|
||||
scrollbar-background: #bbb;
|
||||
padding: 1 2;
|
||||
}
|
||||
scrollbar-corner-color: blue;
|
||||
}
|
||||
|
||||
.panel2 {
|
||||
width: 1fr;
|
||||
scrollbar-color: yellow;
|
||||
scrollbar-background: purple;
|
||||
padding: 1 2;
|
||||
}
|
||||
Horizontal > Container {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from textual.app import App
|
||||
from textual.containers import Vertical
|
||||
from textual.widgets import Static
|
||||
from textual.containers import Horizontal, Container
|
||||
from textual.widgets import Label
|
||||
|
||||
TEXT = """I must not fear.
|
||||
Fear is the mind-killer.
|
||||
@@ -14,8 +14,10 @@ Where the fear has gone there will be nothing. Only I will remain.
|
||||
|
||||
class ScrollbarApp(App):
|
||||
def compose(self):
|
||||
yield Vertical(Static(TEXT * 5), classes="panel1")
|
||||
yield Vertical(Static(TEXT * 5), classes="panel2")
|
||||
yield Horizontal(
|
||||
Container(Label(TEXT * 10)),
|
||||
Container(Label(TEXT * 10), classes="right"),
|
||||
)
|
||||
|
||||
|
||||
app = ScrollbarApp(css_path="scrollbars.css")
|
||||
|
||||
Reference in New Issue
Block a user