Skip to content

Commit

Permalink
Merge pull request #1951 from davep/windows-friendly-toggle-buttons
Browse files Browse the repository at this point in the history
Windows-friendly toggle buttons
  • Loading branch information
davep authored Mar 6, 2023
2 parents 8facffe + 286293b commit 98cc1a7
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 186 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Breaking change: Messages don't require a `sender` in their constructor https://github.com/Textualize/textual/pull/1940
- Many messages have grown a `control` property which returns the control they relate to. https://github.com/Textualize/textual/pull/1940
- Dropped `time` attribute from Messages https://github.com/Textualize/textual/pull/1940
- Changed the `Checkbox` character due to issues with Windows Terminal and Windows 10 https://github.com/Textualize/textual/issues/1934
- Changed the `RadioButton` character due to issues with Windows Terminal and Windows 10 and 11 https://github.com/Textualize/textual/issues/1934

### Added

Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_radio_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class RadioButton(ToggleButton):
A `RadioButton` is best used within a [RadioSet][textual.widgets.RadioSet].
"""

BUTTON_INNER = ""
BUTTON_INNER = "\u25CF"
"""The character used for the inside of the button."""

class Changed(ToggleButton.Changed):
Expand Down
3 changes: 2 additions & 1 deletion src/textual/widgets/_toggle_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ToggleButton(Static, can_focus=True):
ToggleButton > .toggle--button {
color: $background;
text-style: bold;
background: $foreground 15%;
}
Expand Down Expand Up @@ -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 = "▌"
Expand Down
Loading

0 comments on commit 98cc1a7

Please sign in to comment.