mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Horizontal width auto (#1155)
* Improvements to width:auto HorizontalLayout * Fix HorizontalLayout.get_content_width * Horizontal width auto improvement * Removing some printxz * Update snapshot for horizontal layout width auto dock
This commit is contained in:
22
tests/snapshot_tests/snapshot_apps/horizontal_auto_width.py
Normal file
22
tests/snapshot_tests/snapshot_apps/horizontal_auto_width.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Horizontal
|
||||
from textual.widgets import Static
|
||||
|
||||
|
||||
class HorizontalAutoWidth(App):
|
||||
"""
|
||||
Checks that the auto width of the parent Horizontal is correct.
|
||||
"""
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Horizontal(
|
||||
Static("Docked left 1", id="dock-1"),
|
||||
Static("Docked left 2", id="dock-2"),
|
||||
Static("Widget 1", classes="widget"),
|
||||
Static("Widget 2", classes="widget"),
|
||||
id="horizontal",
|
||||
)
|
||||
|
||||
|
||||
app = HorizontalAutoWidth(css_path="horizontal_auto_width.css")
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
Reference in New Issue
Block a user