mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
fix for min and max with fr unints (#2390)
* fix for min and max with fr unints * snapshit * forgot snapshit tests * fix resolve * added unit tests * Windoze fix
This commit is contained in:
50
tests/snapshot_tests/snapshot_apps/fr_with_min.py
Normal file
50
tests/snapshot_tests/snapshot_apps/fr_with_min.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Horizontal, Vertical, VerticalScroll
|
||||
from textual.widgets import Header, Footer, Static
|
||||
|
||||
|
||||
class ScreenSplitApp(App[None]):
|
||||
CSS = """
|
||||
Horizontal {
|
||||
width: 1fr;
|
||||
}
|
||||
|
||||
Vertical {
|
||||
width: 1fr;
|
||||
background: blue;
|
||||
min-width: 20;
|
||||
}
|
||||
|
||||
#scroll1 {
|
||||
width: 1fr;
|
||||
background: $panel;
|
||||
}
|
||||
|
||||
#scroll2 {
|
||||
width: 2fr;
|
||||
background: $panel;
|
||||
}
|
||||
|
||||
Static {
|
||||
width: 1fr;
|
||||
content-align: center middle;
|
||||
background: $boost;
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header()
|
||||
with Horizontal():
|
||||
yield Vertical()
|
||||
with VerticalScroll(id="scroll1"):
|
||||
for n in range(100):
|
||||
yield Static(f"This is content number {n}")
|
||||
with VerticalScroll(id="scroll2"):
|
||||
for n in range(100):
|
||||
yield Static(f"This is content number {n}")
|
||||
yield Footer()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ScreenSplitApp().run()
|
||||
Reference in New Issue
Block a user