]> skyeroc.xyz Git - obs-ctl/commitdiff
add typehints
authorsbkelley <sb24kelley@gmail.com>
Sun, 30 Nov 2025 06:09:23 +0000 (01:09 -0500)
committersbkelley <sb24kelley@gmail.com>
Sun, 30 Nov 2025 06:09:23 +0000 (01:09 -0500)
src/obs_ctl/widget/element/bool_control.py

index 7a0315854f71db222729995f52ba430b7ed6f566..a6b2d71be4b39f879c07452d6c3066ffbd47faa7 100644 (file)
@@ -38,17 +38,17 @@ class BoolControl(Container):
         "bool_control--true_button",
         "bool_control--false_button",
     }
-    value = reactive(False)
-    label = reactive("Status")
-    true_label = reactive("Start")
-    false_label = reactive("Stop")
-    swap_red = reactive(False)
-    compact = reactive(True)
-    control_layout = reactive("vertical")
+    value: reactive[bool] = reactive(False)
+    label: reactive[str] = reactive("Status")
+    true_label: reactive[str] = reactive("Start")
+    false_label: reactive[str] = reactive("Stop")
+    swap_red: reactive[bool] = reactive(False)
+    compact: reactive[bool] = reactive(True)
+    control_layout: reactive[str] = reactive("vertical")
 
     class MsgBase(Message):
         control: "BoolControl" = None
-        def __init__(self, control):
+        def __init__(self, control: "BoolControl"):
             super().__init__()
             self.control = control
     class SetTrue(MsgBase): ...
@@ -57,12 +57,12 @@ class BoolControl(Container):
 
     def __init__(
             self,
-            value,
+            value: bool,
             label: str = "Boolean",
-            true_label = "Start",
-            false_label = "Stop",
-            swap_red = False,
-            compact = True,
+            true_label: str = "Start",
+            false_label: str = "Stop",
+            swap_red: bool = False,
+            compact: bool = True,
             *children,
             layout = "vertical",
             name = None,