mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix illegible calendar buttons in dark mode on Mac/Linux
https://forums.ankiweb.net/t/macos-apple-silicon-2-1-50-dark-mode-statistics-heatmap-buttons-dont-have-icons/18951 This button code is in need of a cleanup.
This commit is contained in:
parent
51a0641bba
commit
29c48a60e0
1 changed files with 8 additions and 5 deletions
|
@ -421,18 +421,22 @@ button:focus {{ outline: 5px auto {color_hl}; }}"""
|
|||
elif is_mac:
|
||||
family = "Helvetica"
|
||||
font = f'font-size:15px;font-family:"{family}";'
|
||||
button_style = """
|
||||
button { -webkit-appearance: none; background: #fff; border: 1px solid #ccc;
|
||||
color = ""
|
||||
if not theme_manager.night_mode:
|
||||
color = "background: #fff; border: 1px solid #ccc;"
|
||||
button_style = (
|
||||
"""
|
||||
button { -webkit-appearance: none; %s
|
||||
border-radius:5px; font-family: Helvetica }"""
|
||||
% color
|
||||
)
|
||||
else:
|
||||
family = self.font().family()
|
||||
color_hl_txt = palette.color(QPalette.ColorRole.HighlightedText).name()
|
||||
color_btn = palette.color(QPalette.ColorRole.Button).name()
|
||||
font = f'font-size:14px;font-family:"{family}", sans-serif;'
|
||||
button_style = """
|
||||
/* Buttons */
|
||||
button{{
|
||||
background-color: {color_btn};
|
||||
font-family:"{family}", sans-serif; }}
|
||||
button:focus{{ border-color: {color_hl} }}
|
||||
button:active, button:active:hover {{ background-color: {color_hl}; color: {color_hl_txt};}}
|
||||
|
@ -443,7 +447,6 @@ div[contenteditable="true"]:focus {{
|
|||
border-color: {color_hl};
|
||||
}}""".format(
|
||||
family=family,
|
||||
color_btn=color_btn,
|
||||
color_hl=color_hl,
|
||||
color_hl_txt=color_hl_txt,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue