Skip to content

Commit

Permalink
fix: Fix some incorrect docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaokang2022 committed Jan 17, 2025
1 parent 7d05863 commit 03d5d27
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions tkintertools/standard/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"""
Expand Down

0 comments on commit 03d5d27

Please sign in to comment.