diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr index cb7b92d30..c142d5d3d 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr +++ b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr @@ -12328,165 +12328,161 @@ font-weight: 700; } - .terminal-717671184-matrix { + .terminal-3590440526-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-717671184-title { + .terminal-3590440526-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-717671184-r1 { fill: #c5c8c6 } - .terminal-717671184-r2 { fill: #e3e3e3 } - .terminal-717671184-r3 { fill: #313437 } - .terminal-717671184-r4 { fill: #324f70 } - .terminal-717671184-r5 { fill: #4f9262 } - .terminal-717671184-r6 { fill: #a4823a } - .terminal-717671184-r7 { fill: #904354 } - .terminal-717671184-r8 { fill: #e1e1e1 } - .terminal-717671184-r9 { fill: #7c7d7e;font-weight: bold } - .terminal-717671184-r10 { fill: #75828b;font-weight: bold } - .terminal-717671184-r11 { fill: #192e1f;font-weight: bold } - .terminal-717671184-r12 { fill: #3a2a13;font-weight: bold } - .terminal-717671184-r13 { fill: #978186;font-weight: bold } - .terminal-717671184-r14 { fill: #101011 } - .terminal-717671184-r15 { fill: #0c1e39 } - .terminal-717671184-r16 { fill: #156034 } - .terminal-717671184-r17 { fill: #825210 } - .terminal-717671184-r18 { fill: #5b132a } - .terminal-717671184-r19 { fill: #768189 } - .terminal-717671184-r20 { fill: #3a2a13 } - .terminal-717671184-r21 { fill: #7b7b7b } - .terminal-717671184-r22 { fill: #78838b } - .terminal-717671184-r23 { fill: #7f8081 } - .terminal-717671184-r24 { fill: #7c7d7e } - .terminal-717671184-r25 { fill: #31220c;font-weight: bold } - .terminal-717671184-r26 { fill: #e2e3e3 } - .terminal-717671184-r27 { fill: #104e2d } - .terminal-717671184-r28 { fill: #7a7b7b } - .terminal-717671184-r29 { fill: #1c1c1c } - .terminal-717671184-r30 { fill: #191919 } - .terminal-717671184-r31 { fill: #181818 } - .terminal-717671184-r32 { fill: #7c7c7c } - .terminal-717671184-r33 { fill: #494949 } - .terminal-717671184-r34 { fill: #14191f } - .terminal-717671184-r35 { fill: #ddedf9 } + .terminal-3590440526-r1 { fill: #454a50 } + .terminal-3590440526-r2 { fill: #507bb3 } + .terminal-3590440526-r3 { fill: #7ae998 } + .terminal-3590440526-r4 { fill: #ffcf56 } + .terminal-3590440526-r5 { fill: #e76580 } + .terminal-3590440526-r6 { fill: #c5c8c6 } + .terminal-3590440526-r7 { fill: #e2e3e3;font-weight: bold } + .terminal-3590440526-r8 { fill: #dde6ed;font-weight: bold } + .terminal-3590440526-r9 { fill: #0a180e;font-weight: bold } + .terminal-3590440526-r10 { fill: #211505;font-weight: bold } + .terminal-3590440526-r11 { fill: #f5e5e9;font-weight: bold } + .terminal-3590440526-r12 { fill: #000000 } + .terminal-3590440526-r13 { fill: #001541 } + .terminal-3590440526-r14 { fill: #008139 } + .terminal-3590440526-r15 { fill: #b86b00 } + .terminal-3590440526-r16 { fill: #780028 } + .terminal-3590440526-r17 { fill: #313437 } + .terminal-3590440526-r18 { fill: #324f70 } + .terminal-3590440526-r19 { fill: #4f9262 } + .terminal-3590440526-r20 { fill: #a4823a } + .terminal-3590440526-r21 { fill: #904354 } + .terminal-3590440526-r22 { fill: #7c7d7e;font-weight: bold } + .terminal-3590440526-r23 { fill: #75828b;font-weight: bold } + .terminal-3590440526-r24 { fill: #192e1f;font-weight: bold } + .terminal-3590440526-r25 { fill: #3a2a13;font-weight: bold } + .terminal-3590440526-r26 { fill: #978186;font-weight: bold } + .terminal-3590440526-r27 { fill: #101011 } + .terminal-3590440526-r28 { fill: #0c1e39 } + .terminal-3590440526-r29 { fill: #156034 } + .terminal-3590440526-r30 { fill: #825210 } + .terminal-3590440526-r31 { fill: #5b132a } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - WidgetDisableTestApp + WidgetDisableTestApp - - - - WidgetDisableTestApp - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - ButtonButtonButtonButtonButton - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ -  Column 1  Column 2  Column 3  Column 4  -  0         0         0         0         - This is list item 0 - This is list item 1 - ▼ This is a test tree - ├── Leaf 0 - Hello, World! - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - This is an empty input with a placeholder - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - This is some text in an input - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - ▇▇ - + + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + ButtonButtonButtonButtonButton + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ diff --git a/tests/snapshot_tests/snapshot_apps/disable_widgets.py b/tests/snapshot_tests/snapshot_apps/disable_widgets.py index 8965fbdac..6677fa5de 100644 --- a/tests/snapshot_tests/snapshot_apps/disable_widgets.py +++ b/tests/snapshot_tests/snapshot_apps/disable_widgets.py @@ -1,83 +1,32 @@ from textual.app import App, ComposeResult -from textual.containers import Vertical, Horizontal -from textual.widgets import ( - Header, - Footer, - Button, - DataTable, - Input, - ListView, - ListItem, - Label, - Markdown, - MarkdownViewer, - Tree, - TextLog, -) - +from textual.containers import Horizontal +from textual.widgets import Button class WidgetDisableTestApp(App[None]): CSS = """ Horizontal { height: auto; } - DataTable, ListView, Tree, TextLog { - height: 2; - } - Markdown, MarkdownViewer { - height: 1fr; + Button { + width: 1fr; } """ - @property - def data_table(self) -> DataTable: - data_table = DataTable[str]() - data_table.add_columns("Column 1", "Column 2", "Column 3", "Column 4") - data_table.add_rows( - [(str(n), str(n * 10), str(n * 100), str(n * 1000)) for n in range(100)] - ) - return data_table - - @property - def list_view(self) -> ListView: - return ListView(*[ListItem(Label(f"This is list item {n}")) for n in range(20)]) - - @property - def test_tree(self) -> Tree: - tree = Tree[None](label="This is a test tree") - for n in range(10): - tree.root.add_leaf(f"Leaf {n}") - tree.root.expand() - return tree - def compose(self) -> ComposeResult: - yield Header() - yield Vertical( - Horizontal( - Button(), - Button(variant="primary"), - Button(variant="success"), - Button(variant="warning"), - Button(variant="error"), - ), - self.data_table, - self.list_view, - self.test_tree, - TextLog(), - Input(), - Input(placeholder="This is an empty input with a placeholder"), - Input("This is some text in an input"), - Markdown("# Hello, World!"), - MarkdownViewer("# Hello, World!"), - id="test-container", - ) - yield Footer() - - def on_mount(self) -> None: - self.query_one(TextLog).write("Hello, World!") - self.query_one("#test-container", Vertical).disabled = True - + for _ in range(4): + with Horizontal(): + yield Button() + yield Button(variant="primary") + yield Button(variant="success") + yield Button(variant="warning") + yield Button(variant="error") + with Horizontal(disabled=True): + yield Button() + yield Button(variant="primary") + yield Button(variant="success") + yield Button(variant="warning") + yield Button(variant="error") if __name__ == "__main__": WidgetDisableTestApp().run()