mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Use custom colors for note view switch
This commit is contained in:
parent
6c48dbcc7f
commit
cb9b452666
2 changed files with 7 additions and 3 deletions
|
@ -19,8 +19,8 @@ class Switch(QAbstractButton):
|
||||||
radius: int = 10,
|
radius: int = 10,
|
||||||
left_label: str = "",
|
left_label: str = "",
|
||||||
right_label: str = "",
|
right_label: str = "",
|
||||||
left_color: tuple[str, str] = colors.FLAG4_BG,
|
left_color: tuple[str, str] = colors.CARD_VIEW_BG,
|
||||||
right_color: tuple[str, str] = colors.FLAG3_BG,
|
right_color: tuple[str, str] = colors.NOTE_VIEW_BG,
|
||||||
parent: QWidget = None,
|
parent: QWidget = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(parent=parent)
|
super().__init__(parent=parent)
|
||||||
|
@ -108,7 +108,7 @@ class Switch(QAbstractButton):
|
||||||
painter.drawEllipse(self._current_knob_rectangle())
|
painter.drawEllipse(self._current_knob_rectangle())
|
||||||
|
|
||||||
def _paint_label(self, painter: QPainter) -> None:
|
def _paint_label(self, painter: QPainter) -> None:
|
||||||
painter.setPen(theme_manager.qcolor(colors.SLIGHTLY_GREY_TEXT))
|
painter.setPen(theme_manager.qcolor(colors.TEXT_FG))
|
||||||
font = painter.font()
|
font = painter.font()
|
||||||
font.setPixelSize(int(1.2 * self._knob_radius))
|
font.setPixelSize(int(1.2 * self._knob_radius))
|
||||||
painter.setFont(font)
|
painter.setFont(font)
|
||||||
|
|
|
@ -30,6 +30,8 @@ $vars: (
|
||||||
highlight-bg: get($color, cyan, 2),
|
highlight-bg: get($color, cyan, 2),
|
||||||
highlight-fg: black,
|
highlight-fg: black,
|
||||||
disabled: get($color, gray, 5),
|
disabled: get($color, gray, 5),
|
||||||
|
card-view-bg: get($color, blue, 5),
|
||||||
|
note-view-bg: get($color, green, 5),
|
||||||
flag1-fg: get($color, red, 6),
|
flag1-fg: get($color, red, 6),
|
||||||
flag2-fg: get($color, orange, 5),
|
flag2-fg: get($color, orange, 5),
|
||||||
flag3-fg: get($color, green, 5),
|
flag3-fg: get($color, green, 5),
|
||||||
|
@ -66,6 +68,8 @@ $vars: (
|
||||||
highlight-bg: get($color, cyan, 2),
|
highlight-bg: get($color, cyan, 2),
|
||||||
highlight-fg: white,
|
highlight-fg: white,
|
||||||
disabled: get($color, gray, 6),
|
disabled: get($color, gray, 6),
|
||||||
|
card-view-bg: get($color, blue, 4),
|
||||||
|
note-view-bg: get($color, green, 4),
|
||||||
flag1-fg: get($color, red, 4),
|
flag1-fg: get($color, red, 4),
|
||||||
flag2-fg: get($color, orange, 4),
|
flag2-fg: get($color, orange, 4),
|
||||||
flag3-fg: get($color, green, 4),
|
flag3-fg: get($color, green, 4),
|
||||||
|
|
Loading…
Reference in a new issue