Add support for general -> print-element-backgrounds with WebEngine
This commit is contained in:
parent
a40db1735e
commit
df245dae48
@ -29,6 +29,7 @@ Added
|
||||
- Support for the `storage -> cache-size` option with QtWebEngine
|
||||
- Support for the `colors -> webpage.bg` option with QtWebEngine
|
||||
- Support for the HTML5 fullscreen API (e.g. youtube videos) with QtWebEngine
|
||||
- Support for the `general -> print-element-backgrounds` option with QtWebEngine on Qt >= 5.8
|
||||
|
||||
Changed
|
||||
~~~~~~~
|
||||
|
@ -185,7 +185,6 @@ def shutdown():
|
||||
# - AutoLoadIconsForPage (5.7)
|
||||
# - TouchIconsEnabled (5.7)
|
||||
# - FocusOnNavigationEnabled (5.8)
|
||||
# - PrintElementBackgrounds (5.8)
|
||||
# - AllowRunningInsecureContent (5.8)
|
||||
#
|
||||
# Missing QtWebEngine fonts:
|
||||
@ -288,3 +287,10 @@ try:
|
||||
except AttributeError:
|
||||
# Added in Qt 5.7
|
||||
pass
|
||||
|
||||
try:
|
||||
MAPPINGS['general']['print-element-backgrounds'] = Attribute(
|
||||
QWebEngineSettings.PrintElementBackgrounds)
|
||||
except AttributeError:
|
||||
# Added in Qt 5.8
|
||||
pass
|
||||
|
@ -200,9 +200,12 @@ def data(readonly=False):
|
||||
|
||||
('print-element-backgrounds',
|
||||
SettingValue(typ.Bool(), 'true',
|
||||
backends=[usertypes.Backend.QtWebKit]),
|
||||
backends=(None if qtutils.version_check('5.8')
|
||||
else [usertypes.Backend.QtWebKit])),
|
||||
"Whether the background color and images are also drawn when the "
|
||||
"page is printed."),
|
||||
"page is printed.\n"
|
||||
"This setting only works with Qt 5.8 or newer when using the "
|
||||
"QtWebEngine backend."),
|
||||
|
||||
('xss-auditing',
|
||||
SettingValue(typ.Bool(), 'false'),
|
||||
|
@ -365,6 +365,8 @@ def generate_commands(filename):
|
||||
|
||||
def _generate_setting_section(f, sectname, sect):
|
||||
"""Generate documentation for a single section."""
|
||||
version_dependent_options = [('network', 'proxy'),
|
||||
('general', 'print-element-backgrounds')]
|
||||
for optname, option in sect.items():
|
||||
f.write("\n")
|
||||
f.write('[[{}-{}]]'.format(sectname, optname) + "\n")
|
||||
@ -391,7 +393,7 @@ def _generate_setting_section(f, sectname, sect):
|
||||
f.write("Default: empty\n")
|
||||
|
||||
if (option.backends is None or
|
||||
(sectname, optname) == ('network', 'proxy')):
|
||||
(sectname, optname) in version_dependent_options):
|
||||
pass
|
||||
elif option.backends == [usertypes.Backend.QtWebKit]:
|
||||
f.write("\nThis setting is only available with the QtWebKit "
|
||||
|
Loading…
Reference in New Issue
Block a user