From f7a6981abfc4f74158ba5fda726986f3b8d4c93f Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 6 Mar 2023 11:19:29 +0000 Subject: [PATCH] Swap the checkbox character to an X See #1934. Simply put: the character that we were doesn't render well at all in Windows Terminal on Windows 10; while there are other options available, few seem to work well there either. So here we go for a bold X; this should render fine everywhere. --- src/textual/widgets/_toggle_button.py | 3 +- .../__snapshots__/test_snapshots.ambr | 368 +++++++++--------- 2 files changed, 186 insertions(+), 185 deletions(-) diff --git a/src/textual/widgets/_toggle_button.py b/src/textual/widgets/_toggle_button.py index dc1fee373..0a3cfdc62 100644 --- a/src/textual/widgets/_toggle_button.py +++ b/src/textual/widgets/_toggle_button.py @@ -65,6 +65,7 @@ class ToggleButton(Static, can_focus=True): ToggleButton > .toggle--button { color: $background; + text-style: bold; background: $foreground 15%; } @@ -99,7 +100,7 @@ class ToggleButton(Static, can_focus=True): BUTTON_LEFT: str = "▐" """The character used for the left side of the toggle button.""" - BUTTON_INNER: str = "✖" + BUTTON_INNER: str = "X" """The character used for the inside of the button.""" BUTTON_RIGHT: str = "▌" diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr index 744398edd..40b54683f 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr +++ b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr @@ -367,140 +367,140 @@ font-weight: 700; } - .terminal-2048600128-matrix { + .terminal-2698519028-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-2048600128-title { + .terminal-2698519028-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-2048600128-r1 { fill: #e1e1e1 } - .terminal-2048600128-r2 { fill: #c5c8c6 } - .terminal-2048600128-r3 { fill: #004578 } - .terminal-2048600128-r4 { fill: #42464b } - .terminal-2048600128-r5 { fill: #24292f } - .terminal-2048600128-r6 { fill: #e2e3e3 } - .terminal-2048600128-r7 { fill: #e2e3e3;font-weight: bold } - .terminal-2048600128-r8 { fill: #98729f } - .terminal-2048600128-r9 { fill: #4ebf71 } - .terminal-2048600128-r10 { fill: #565a5e } - .terminal-2048600128-r11 { fill: #e2e3e3;text-decoration: underline; } + .terminal-2698519028-r1 { fill: #e1e1e1 } + .terminal-2698519028-r2 { fill: #c5c8c6 } + .terminal-2698519028-r3 { fill: #004578 } + .terminal-2698519028-r4 { fill: #42464b } + .terminal-2698519028-r5 { fill: #24292f } + .terminal-2698519028-r6 { fill: #e2e3e3 } + .terminal-2698519028-r7 { fill: #e2e3e3;font-weight: bold } + .terminal-2698519028-r8 { fill: #98729f } + .terminal-2698519028-r9 { fill: #4ebf71;font-weight: bold } + .terminal-2698519028-r10 { fill: #565a5e } + .terminal-2698519028-r11 { fill: #e2e3e3;text-decoration: underline; } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - CheckboxApp + CheckboxApp - + - - - - - - - ─────────────────── - - - Arrakis 😓 - Caladan - Chusuk - Giedi Prime - Ginaz - Grumman - Kaitain - Novebruns - - - ─────────────────── - - - - + + + + + + + ─────────────────── + + + XArrakis 😓 + XCaladan + XChusuk + XGiedi Prime + XGinaz + XGrumman + XKaitain + XNovebruns + + + ─────────────────── + + + + @@ -15303,137 +15303,137 @@ font-weight: 700; } - .terminal-564795652-matrix { + .terminal-850730190-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-564795652-title { + .terminal-850730190-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-564795652-r1 { fill: #e1e1e1 } - .terminal-564795652-r2 { fill: #c5c8c6 } - .terminal-564795652-r3 { fill: #666666 } - .terminal-564795652-r4 { fill: #3d3d3d } - .terminal-564795652-r5 { fill: #1e1e1e } - .terminal-564795652-r6 { fill: #515151 } - .terminal-564795652-r7 { fill: #e1e1e1;text-decoration: underline; } - .terminal-564795652-r8 { fill: #4ebf71 } + .terminal-850730190-r1 { fill: #e1e1e1 } + .terminal-850730190-r2 { fill: #c5c8c6 } + .terminal-850730190-r3 { fill: #666666 } + .terminal-850730190-r4 { fill: #3d3d3d } + .terminal-850730190-r5 { fill: #1e1e1e } + .terminal-850730190-r6 { fill: #515151 } + .terminal-850730190-r7 { fill: #e1e1e1;text-decoration: underline; } + .terminal-850730190-r8 { fill: #4ebf71;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - RadioChoicesApp + RadioChoicesApp - + - - - - - - - - ─────────────────────────────────────── - Battlestar Galactica - Dune 1984 - Dune 2021 - Serenity - Star Trek: The Motion Picture - Star Wars: A New Hope - The Last Starfighter - Total Recall 👉 🔴 - Wing Commander - ─────────────────────────────────────── - - - - - - + + + + + + + + ─────────────────────────────────────── + Battlestar Galactica + Dune 1984 + Dune 2021 + Serenity + Star Trek: The Motion Picture + Star Wars: A New Hope + The Last Starfighter + Total Recall 👉 🔴 + Wing Commander + ─────────────────────────────────────── + + + + + + @@ -15464,138 +15464,138 @@ font-weight: 700; } - .terminal-3736601564-matrix { + .terminal-1626605478-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3736601564-title { + .terminal-1626605478-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3736601564-r1 { fill: #e1e1e1 } - .terminal-3736601564-r2 { fill: #c5c8c6 } - .terminal-3736601564-r3 { fill: #666666 } - .terminal-3736601564-r4 { fill: #3d3d3d } - .terminal-3736601564-r5 { fill: #1e1e1e } - .terminal-3736601564-r6 { fill: #4ebf71 } - .terminal-3736601564-r7 { fill: #cc555a;font-weight: bold;font-style: italic; } - .terminal-3736601564-r8 { fill: #515151 } - .terminal-3736601564-r9 { fill: #e1e1e1;text-decoration: underline; } + .terminal-1626605478-r1 { fill: #e1e1e1 } + .terminal-1626605478-r2 { fill: #c5c8c6 } + .terminal-1626605478-r3 { fill: #666666 } + .terminal-1626605478-r4 { fill: #3d3d3d } + .terminal-1626605478-r5 { fill: #1e1e1e } + .terminal-1626605478-r6 { fill: #4ebf71;font-weight: bold } + .terminal-1626605478-r7 { fill: #cc555a;font-weight: bold;font-style: italic; } + .terminal-1626605478-r8 { fill: #515151 } + .terminal-1626605478-r9 { fill: #e1e1e1;text-decoration: underline; } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - RadioChoicesApp + RadioChoicesApp - + - - - - - - - - ────────────────────────────────────────────────────────────────────── - Battlestar GalacticaAmanda - Dune 1984Connor MacLeod - Dune 2021Duncan MacLeod - SerenityHeather MacLeod - Star Trek: The Motion PictureJoe Dawson - Star Wars: A New HopeKurgan, The - The Last StarfighterMethos - Total Recall 👉 🔴Rachel Ellenstein - Wing CommanderRamírez - ────────────────────────────────────────────────────────────────────── - - - - - - + + + + + + + + ────────────────────────────────────────────────────────────────────── + Battlestar GalacticaAmanda + Dune 1984Connor MacLeod + Dune 2021Duncan MacLeod + SerenityHeather MacLeod + Star Trek: The Motion PictureJoe Dawson + Star Wars: A New HopeKurgan, The + The Last StarfighterMethos + Total Recall 👉 🔴Rachel Ellenstein + Wing CommanderRamírez + ────────────────────────────────────────────────────────────────────── + + + + + +