跳转至

maliang.standard.styles

字数 605 个   代码 96 行   阅读时间 3 分钟   访问量

源代码:maliang/standard/styles.py

All standard Style classes

🟢ButtonStyle

class public | LabelStyle

🟢CheckBoxStyle

class public | ToggleButtonStyle

🟢HighlightButtonStyle

class public | TextStyle

🟢IconButtonStyle

class public | LabelStyle

🟢InputBoxStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
9
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,
    bg_bar: 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.
  • bg_bar: the highlight bar of the widget (Only for Windows11 theme)

states: “normal”, “hover”, “active”

🟢LabelStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
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”

🟢OptionButtonStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
def set(
    self,
    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 both
  • bg: the background color of the widget.
  • ol: the outline color of the widget.

states: “normal”, “hover”, “active”

🟢ProgressBarStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
9
def set(
    self,
    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 both
  • bg_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”

🟢RadioBoxStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
9
def set(
    self,
    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 both
  • bg_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”

🟢SegmentedButtonStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
def set(
    self,
    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 both
  • bg: the background color of the widget.
  • ol: the outline color of the widget.

states: “normal”, “hover”

🟢SliderStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
9
def set(
    self,
    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 both
  • fg_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”

🟢SpinnerStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
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,
) -> 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.

states: “normal”

🟢SwitchStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
9
def set(
    self,
    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 both
  • bg_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”

🟢TextStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
def set(
    self,
    theme: typing.Literal['light', 'dark'] | None = None,
    *,
    fg: 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

states: “normal”, “hover”, “active”

🟢ToggleButtonStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
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-off”, “hover-off”, “active-off”, “normal-on”, “hover-on”, “active-on”

🟢TooltipStyle

class public | Style

🟡set

method public

1
2
3
4
5
6
7
8
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”

🟢UnderlineButtonStyle

class public | TextStyle