Fix height example.

[skip ci]
This commit is contained in:
Rodrigo Girão Serrão
2023-01-07 09:44:28 +00:00
parent 08baaf11f3
commit aad41b8de0
3 changed files with 13 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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")