mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* 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
23 lines
650 B
Python
23 lines
650 B
Python
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()
|