mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Remove hardcoded note/card colours from switch.py (#3629)
* Remove hardcoded note/card colours in switch.py * Modify CONTRIBUTORS * Switch to None as a safe default value
This commit is contained in:
parent
36d0fddd38
commit
2d207ff5ba
2 changed files with 5 additions and 4 deletions
|
@ -201,6 +201,7 @@ Dongjin Ouyang <1113117424@qq.com>
|
|||
Sawan Sunar <sawansunar24072002@gmail.com>
|
||||
hideo aoyama <https://github.com/boukendesho>
|
||||
Ross Brown <rbrownwsws@googlemail.com>
|
||||
🦙 <github.com/iamllama>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ class Switch(QAbstractButton):
|
|||
radius: int = 10,
|
||||
left_label: str = "",
|
||||
right_label: str = "",
|
||||
left_color: dict[str, str] = colors.ACCENT_CARD | {},
|
||||
right_color: dict[str, str] = colors.ACCENT_NOTE | {},
|
||||
left_color: dict[str, str] | None = None,
|
||||
right_color: dict[str, str] | None = None,
|
||||
parent: QWidget | None = None,
|
||||
) -> None:
|
||||
super().__init__(parent=parent)
|
||||
|
@ -31,8 +31,8 @@ class Switch(QAbstractButton):
|
|||
self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
self._left_label = left_label
|
||||
self._right_label = right_label
|
||||
self._left_color = left_color
|
||||
self._right_color = right_color
|
||||
self._left_color = left_color if left_color else colors.ACCENT_CARD
|
||||
self._right_color = right_color if right_color else colors.ACCENT_NOTE
|
||||
self._path_radius = radius
|
||||
self._knob_radius = radius - 2
|
||||
self._label_padding = 4
|
||||
|
|
Loading…
Reference in a new issue