From 03d5d27cecc224b059235d35e89e32cf165e4be0 Mon Sep 17 00:00:00 2001 From: Xiaokang2022 <2951256653@qq.com> Date: Fri, 17 Jan 2025 16:30:50 +0800 Subject: [PATCH] fix: Fix some incorrect docstrings --- tkintertools/standard/styles.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tkintertools/standard/styles.py b/tkintertools/standard/styles.py index 701c583e..1b67e24b 100644 --- a/tkintertools/standard/styles.py +++ b/tkintertools/standard/styles.py @@ -57,7 +57,7 @@ def set( * `theme`: the theme name, None indicates both * `fg`: the foreground color of the widget - states: "normal", "hover", "active" + states: "normal" """ self._set(theme, fg, fill=-1) self.widget.update() @@ -112,7 +112,7 @@ def set( * `bg`: the background color of the widget. * `ol`: the outline color of the widget. - states: "normal", "hover", "active" + states: "normal", "hover" """ self._set(theme, fg, fill=-1) self._set(theme, bg, fill=0) @@ -159,6 +159,26 @@ class ButtonStyle(LabelStyle): } } + @typing_extensions.override + def set( + self, + theme: typing.Literal["light", "dark"] | None = None, + *, + fg: tuple[str | types.EllipsisType, ...] | str | None = None, + bg: tuple[str | types.EllipsisType, ...] | str | None = None, + ol: tuple[str | types.EllipsisType, ...] | str | None = None, + ) -> None: + """Set the style of the widget. + + * `theme`: the theme name, None indicates both + * `fg`: the foreground color of the widget. + * `bg`: the background color of the widget. + * `ol`: the outline color of the widget. + + states: "normal", "hover", "active" + """ + LabelStyle.set(self, theme, fg=fg, bg=bg, ol=ol) + class SwitchStyle(virtual.Style): """Style of Switch"""