mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the QT_VERSION available to the JS runtime
This commit is contained in:
parent
d2db909851
commit
6436d36f2e
@ -9,7 +9,7 @@ import sys
|
|||||||
from itertools import count
|
from itertools import count
|
||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QHBoxLayout, QSize,
|
QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QHBoxLayout, QSize, QT_VERSION,
|
||||||
Qt, QTimer, QUrl, QWidget, pyqtSignal
|
Qt, QTimer, QUrl, QWidget, pyqtSignal
|
||||||
)
|
)
|
||||||
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler
|
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler
|
||||||
@ -581,6 +581,7 @@ class WebView(RestartingWebEngineView):
|
|||||||
'ui_font_sz': '{}px'.format(fi.pixelSize()),
|
'ui_font_sz': '{}px'.format(fi.pixelSize()),
|
||||||
'show_home_page_on_ready': self.show_home_page_on_ready,
|
'show_home_page_on_ready': self.show_home_page_on_ready,
|
||||||
'system_colors': system_colors(),
|
'system_colors': system_colors(),
|
||||||
|
'QT_VERSION': QT_VERSION,
|
||||||
}
|
}
|
||||||
self.bridge.create_view(
|
self.bridge.create_view(
|
||||||
vprefs['session_data'], vprefs['local_storage'], field_metadata.all_metadata(), ui_data)
|
vprefs['session_data'], vprefs['local_storage'], field_metadata.all_metadata(), ui_data)
|
||||||
|
@ -81,6 +81,7 @@ runtime = {
|
|||||||
'is_standalone_viewer': False,
|
'is_standalone_viewer': False,
|
||||||
'viewer_in_full_screen': False,
|
'viewer_in_full_screen': False,
|
||||||
'in_develop_mode': IN_DEVELOP_MODE is '1',
|
'in_develop_mode': IN_DEVELOP_MODE is '1',
|
||||||
|
'QT_VERSION': 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -175,6 +175,7 @@ def create_view(prefs, local_storage, field_metadata, ui_data):
|
|||||||
library_data.field_metadata = field_metadata
|
library_data.field_metadata = field_metadata
|
||||||
document.documentElement.style.fontFamily = f'"{ui_data.ui_font_family}", sans-serif'
|
document.documentElement.style.fontFamily = f'"{ui_data.ui_font_family}", sans-serif'
|
||||||
document.documentElement.style.fontSize = ui_data.ui_font_sz
|
document.documentElement.style.fontSize = ui_data.ui_font_sz
|
||||||
|
runtime.QT_VERSION = ui_data.QT_VERSION
|
||||||
if view is None:
|
if view is None:
|
||||||
create_session_data(prefs, local_storage)
|
create_session_data(prefs, local_storage)
|
||||||
view = View(document.getElementById('view'))
|
view = View(document.getElementById('view'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user