From 429c8a3649fe570fbaf495cf8fa648f443b211db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:48:49 +0000 Subject: [PATCH] Tweak default Center/Middle dimensions. We set dimensions to 1fr instead of 100% (original request) or blank (previous change) for consistency with the other containers. --- src/textual/containers.py | 2 + .../__snapshots__/test_snapshots.ambr | 125 +++++++++--------- 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/src/textual/containers.py b/src/textual/containers.py index 0c8d61dcb..fbae6ecb7 100644 --- a/src/textual/containers.py +++ b/src/textual/containers.py @@ -68,6 +68,7 @@ class Center(Widget): Center { align-horizontal: center; height: auto; + width: 1fr; } """ @@ -79,6 +80,7 @@ class Middle(Widget): Middle { align-vertical: middle; width: auto; + height: 1fr; } """ diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr index 7130b1f5f..19dfd1a6c 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr +++ b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr @@ -21,139 +21,138 @@ font-weight: 700; } - .terminal-258300109-matrix { + .terminal-1593336641-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-258300109-title { + .terminal-1593336641-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-258300109-r1 { fill: #c5c8c6 } - .terminal-258300109-r2 { fill: #7ae998 } - .terminal-258300109-r3 { fill: #e1e1e1 } - .terminal-258300109-r4 { fill: #0a180e;font-weight: bold } - .terminal-258300109-r5 { fill: #008139 } - .terminal-258300109-r6 { fill: #e3dbce } - .terminal-258300109-r7 { fill: #e76580 } - .terminal-258300109-r8 { fill: #f5e5e9;font-weight: bold } - .terminal-258300109-r9 { fill: #780028 } - .terminal-258300109-r10 { fill: #14191f } + .terminal-1593336641-r1 { fill: #c5c8c6 } + .terminal-1593336641-r2 { fill: #7ae998 } + .terminal-1593336641-r3 { fill: #0a180e;font-weight: bold } + .terminal-1593336641-r4 { fill: #008139 } + .terminal-1593336641-r5 { fill: #e3dbce } + .terminal-1593336641-r6 { fill: #e1e1e1 } + .terminal-1593336641-r7 { fill: #e76580 } + .terminal-1593336641-r8 { fill: #f5e5e9;font-weight: bold } + .terminal-1593336641-r9 { fill: #780028 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - AlignContainersApp + AlignContainersApp - - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - center - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - - - - - - - - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - middle - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - - - - - ▅▅ - + + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + center + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + + + + + + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + middle + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + + + + + + +