mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix height example.
[skip ci]
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
height: 12.5h; /* (4)! */
|
||||
}
|
||||
#vw {
|
||||
height: 7.5vw; /* (5)! */
|
||||
height: 6.25vw; /* (5)! */
|
||||
}
|
||||
#vh {
|
||||
height: 12.5vh; /* (6)! */
|
||||
@@ -26,9 +26,14 @@
|
||||
height: 2fr; /* (9)! */
|
||||
}
|
||||
|
||||
VerticalRuler {
|
||||
Screen {
|
||||
layers: ruler;
|
||||
}
|
||||
|
||||
Ruler {
|
||||
layer: ruler;
|
||||
dock: right;
|
||||
overflow: hidden;
|
||||
width: auto;
|
||||
width: 1;
|
||||
background: $accent;
|
||||
}
|
||||
|
||||
@@ -3,16 +3,16 @@ from textual.containers import Vertical
|
||||
from textual.widgets import Placeholder, Label, Static
|
||||
|
||||
|
||||
class VerticalRuler(Static):
|
||||
class Ruler(Static):
|
||||
def compose(self):
|
||||
ruler_text = "\n".join(map(str, range(1, 100)))
|
||||
ruler_text = "·\n·\n·\n·\n•\n" * 100
|
||||
yield Label(ruler_text)
|
||||
|
||||
|
||||
class HeightComparisonApp(App):
|
||||
def compose(self):
|
||||
yield Vertical(
|
||||
Placeholder(id="cells"), # (1)!
|
||||
Placeholder(id="cells"), # (1)!
|
||||
Placeholder(id="percent"),
|
||||
Placeholder(id="w"),
|
||||
Placeholder(id="h"),
|
||||
@@ -22,7 +22,7 @@ class HeightComparisonApp(App):
|
||||
Placeholder(id="fr1"),
|
||||
Placeholder(id="fr2"),
|
||||
)
|
||||
yield VerticalRuler()
|
||||
yield Ruler()
|
||||
|
||||
|
||||
app = HeightComparisonApp(css_path="height_comparison.css")
|
||||
|
||||
Reference in New Issue
Block a user