From be9e34ba9a0e6dd309b70e2f3031dd50b5660880 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 9 Feb 2023 16:06:00 +0000 Subject: [PATCH] Switch docstring additions and tweaks --- src/textual/widgets/_switch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/textual/widgets/_switch.py b/src/textual/widgets/_switch.py index f6aa88601..c0a01188f 100644 --- a/src/textual/widgets/_switch.py +++ b/src/textual/widgets/_switch.py @@ -144,12 +144,17 @@ class Switch(Widget, can_focus=True): return 1 def on_click(self) -> None: + """Toggle the state of the switch.""" self.toggle() def action_toggle(self) -> None: + """Toggle the state of the switch.""" self.toggle() def toggle(self) -> None: - """Toggle the switch value. As a result of the value changing, - a Switch.Changed message will be posted.""" + """Toggle the switch value. + + As a result of the value changing, a `Switch.Changed` message will + be posted. + """ self.value = not self.value