macOS: Fix viewer controls not using system UI font

This commit is contained in:
Kovid Goyal 2020-01-01 10:45:37 +05:30
parent b966cdcef7
commit 3bcf55d571
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 18 additions and 7 deletions

View File

@ -2,7 +2,16 @@
* Reset CSS to suppress cross-browser differences
*/
html, body, div, span, object, iframe,
html, body {
margin:0;
padding:0;
border:0;
outline:0;
vertical-align:baseline;
background:transparent;
}
div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
@ -25,7 +34,6 @@ time, mark, audio, video {
body {
line-height:1.2;
font-family:sans-serif;
}
article,aside,details,figcaption,figure,

View File

@ -535,9 +535,12 @@ class WebView(RestartingWebEngineView):
def on_bridge_ready(self):
f = QApplication.instance().font()
fi = QFontInfo(f)
family = f.family()
if family in ('.AppleSystemUIFont', 'MS Shell Dlg 2'):
family = 'system-ui'
ui_data = {
'all_font_families': QFontDatabase().families(),
'ui_font_family': f.family(),
'ui_font_family': family,
'ui_font_sz': '{}px'.format(fi.pixelSize()),
'show_home_page_on_ready': self.show_home_page_on_ready,
'system_colors': system_colors(),