maliang.standard.styles¶
字数 9 个 阅读时间不到 1 分钟 访问量
源代码:maliang/standard/styles.py
All standard Style
classes
类:
-
TextStyle
–Style of Text
-
LabelStyle
–Style of Label
-
ButtonStyle
–Style of Button
-
SwitchStyle
–Style of Switch
-
InputBoxStyle
–Style of InputBox
-
ToggleButtonStyle
–Style of ToggleButton
-
CheckBoxStyle
–Style of CheckBox
-
RadioBoxStyle
–Style of RadioGroup
-
ProgressBarStyle
–Style of ProgressBar
-
UnderlineButtonStyle
–Style of UnderlineButton
-
HighlightButtonStyle
–Style of HighlightButtonStyle
-
IconButtonStyle
–Style of IconButtonStyle
-
SliderStyle
–Style of Slider
-
SegmentedButtonStyle
–Style of SegmentedButton
-
OptionButtonStyle
–Style of OptionButton
-
SpinnerStyle
–Style of Spinner
-
TooltipStyle
–Style of Tooltip
LabelStyle ¶
Style of Label
方法:
-
set
–Set the style of the widget.
set ¶
set(
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 bothfg
: the foreground color of the widget.bg
: the background color of the widget.ol
: the outline color of the widget.
states: “normal”, “hover”
ButtonStyle ¶
Bases: LabelStyle
Style of Button
方法:
-
set
–Set the style of the widget.
set ¶
set(
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 bothfg
: the foreground color of the widget.bg
: the background color of the widget.ol
: the outline color of the widget.
states: “normal”, “hover”, “active”
SwitchStyle ¶
Style of Switch
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | None = None,
*,
bg_slot: tuple[str | types.EllipsisType, ...] | str | None = None,
ol_slot: tuple[str | types.EllipsisType, ...] | str | None = None,
bg_dot: tuple[str | types.EllipsisType, ...] | str | None = None,
ol_dot: tuple[str | types.EllipsisType, ...] | str | None = None
) -> None
Set the style of the widget.
theme
: the theme name, None indicates bothbg_slot
: the background color of the widget.ol_slot
: the outline color of the widget.bg_dot
: the inside background color of the widget.ol_dot
: the inside outline color of the widget.
states: “normal-off”, “hover-off”, “active-off”, “normal-on”, “hover-on”, “active-on”
InputBoxStyle ¶
Style of InputBox
方法:
-
set
–Set the style of the widget.
set ¶
set(
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,
bg_bar: tuple[str | types.EllipsisType, ...] | str | None = None
) -> None
Set the style of the widget.
theme
: the theme name, None indicates bothfg
: the foreground color of the widget.bg
: the background color of the widget.ol
: the outline color of the widget.bg_bar
: the highlight bar of the widget (Only for Windows11 theme)
states: “normal”, “hover”, “active”
ToggleButtonStyle ¶
Style of ToggleButton
方法:
-
set
–Set the style of the widget.
set ¶
set(
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 bothfg
: the foreground color of the widget.bg
: the background color of the widget.ol
: the outline color of the widget.
states: “normal-off”, “hover-off”, “active-off”, “normal-on”, “hover-on”, “active-on”
CheckBoxStyle ¶
RadioBoxStyle ¶
Style of RadioGroup
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | None = None,
*,
bg_box: tuple[str | types.EllipsisType, ...] | str | None = None,
ol_box: tuple[str | types.EllipsisType, ...] | str | None = None,
bg_dot: tuple[str | types.EllipsisType, ...] | str | None = None,
ol_dot: tuple[str | types.EllipsisType, ...] | str | None = None
) -> None
Set the style of the widget.
theme
: the theme name, None indicates bothbg_box
: the background color of the widget.ol_box
: the outline color of the widget.bg_dot
: the inside background color of the widget.ol_dot
: the inside outline color of the widget.
states: “normal”, “hover”, “active”
ProgressBarStyle ¶
Style of ProgressBar
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | None = None,
*,
bg_slot: tuple[str | types.EllipsisType, ...] | str | None = None,
ol_slot: tuple[str | types.EllipsisType, ...] | str | None = None,
bg_bar: tuple[str | types.EllipsisType, ...] | str | None = None,
ol_bar: tuple[str | types.EllipsisType, ...] | str | None = None
) -> None
Set the style of the widget.
theme
: the theme name, None indicates bothbg_slot
: the background color of the widget.ol_slot
: the outline color of the widget.bg_bar
: the inside background color of the widget.ol_bar
: the inside outline color of the widget.
states: “normal”, “hover”
UnderlineButtonStyle ¶
HighlightButtonStyle ¶
IconButtonStyle ¶
SliderStyle ¶
Style of Slider
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | None = None,
*,
fg_slot: tuple[str | types.EllipsisType, ...] | str | None = None,
bg_slot: tuple[str | types.EllipsisType, ...] | str | None = None,
bg_pnt: tuple[str | types.EllipsisType, ...] | str | None = None,
bg_dot: tuple[str | types.EllipsisType, ...] | str | None = None
) -> None
Set the style of the widget.
theme
: the theme name, None indicates bothfg_slot
: the foreground color of the widget.bg_slot
: the background color of the widget.bg_pnt
: the pointer color of the widget.bg_dot
: the pointer highlight part color of the widget (Only for Windows11 theme).
states: “normal”, “hover”, “active”
SegmentedButtonStyle ¶
Style of SegmentedButton
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | 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 bothbg
: the background color of the widget.ol
: the outline color of the widget.
states: “normal”, “hover”
ToggleButtonStyle4SB ¶
OptionButtonStyle ¶
Style of OptionButton
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | 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 bothbg
: the background color of the widget.ol
: the outline color of the widget.
states: “normal”, “hover”, “active”
SpinnerStyle ¶
Style of Spinner
方法:
-
set
–Set the style of the widget.
set ¶
set(
theme: typing.Literal["light", "dark"] | None = None,
*,
fg: tuple[str | types.EllipsisType, ...] | str | None = None,
bg: tuple[str | types.EllipsisType, ...] | str | None = None
) -> None
Set the style of the widget.
theme
: the theme name, None indicates bothfg
: the foreground color of the widget.bg
: the background color of the widget.
states: “normal”
TooltipStyle ¶
Style of Tooltip
方法:
-
set
–Set the style of the widget.
set ¶
set(
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 bothfg
: the foreground color of the widget.bg
: the background color of the widget.ol
: the outline color of the widget.
states: “normal”