fall back on a sans-serif font if the system Linux font is unavailable

The GNOME theme may return "Cantarell", which may not be installed.
This commit is contained in:
Damien Elmes 2022-01-22 16:43:58 +10:00
parent 6b6d0b0820
commit 5c100b4189

View File

@ -421,12 +421,12 @@ border-radius:5px; font-family: Helvetica }"""
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}";'
font = f'font-size:14px;font-family:"{family}", sans-serif;'
button_style = """
/* Buttons */
button{{
background-color: {color_btn};
font-family:"{family}"; }}
font-family:"{family}", sans-serif; }}
button:focus{{ border-color: {color_hl} }}
button:active, button:active:hover {{ background-color: {color_hl}; color: {color_hl_txt};}}
/* Input field focus outline */