Skip to content

Commit eacc625

Browse files
committed
Updated ToggleButton patch for 3.2.0
1 parent b7ec0ff commit eacc625

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/installer/terminal.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ def cell_len(text: str, _cell_len: Callable[[str], int] = cells.cached_cell_len)
119119
def patch_toggle_button(unicode: bool) -> None:
120120
from textual.widgets._toggle_button import ToggleButton
121121
from textual.widgets._radio_button import RadioButton
122-
from rich.text import Text
123-
from rich.style import Style
122+
from textual.content import Content
123+
from textual.style import Style
124124

125125
class PatchedToggleButton(ToggleButton):
126126
@property
127-
def _button(self) -> Text:
128-
button_style = self.get_component_rich_style('toggle--button')
129-
side_style = Style.from_color(self.colors[3].rich_color,
130-
self.background_colors[1].rich_color)
131-
return Text.assemble(
127+
def _button(self) -> Content:
128+
button_style = self.get_visual_style("toggle--button")
129+
side_style = Style(self.colors[3],
130+
self.background_colors[1])
131+
return Content.assemble(
132132
(self.BUTTON_LEFT, side_style),
133133
(self.BUTTON_INNER, button_style),
134134
(self.BUTTON_RIGHT, side_style)

0 commit comments

Comments
 (0)