mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, ClassVar
|
|||||||
from rich.console import RenderableType
|
from rich.console import RenderableType
|
||||||
|
|
||||||
from ..binding import Binding, BindingType
|
from ..binding import Binding, BindingType
|
||||||
|
from ..events import Click
|
||||||
from ..geometry import Size
|
from ..geometry import Size
|
||||||
from ..message import Message
|
from ..message import Message
|
||||||
from ..reactive import reactive
|
from ..reactive import reactive
|
||||||
@@ -153,7 +154,7 @@ class Switch(Widget, can_focus=True):
|
|||||||
def get_content_height(self, container: Size, viewport: Size, width: int) -> int:
|
def get_content_height(self, container: Size, viewport: Size, width: int) -> int:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def on_click(self) -> None:
|
async def _on_click(self, _: Click) -> None:
|
||||||
"""Toggle the state of the switch."""
|
"""Toggle the state of the switch."""
|
||||||
self.toggle()
|
self.toggle()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user