Add a qt.force_platformtheme setting

This commit is contained in:
Florian Bruhin 2019-12-29 13:41:14 +01:00
parent ab916993db
commit 7c4ba0b86b
5 changed files with 29 additions and 0 deletions

View File

@ -31,6 +31,8 @@ Added
- New `content.site_specific_quirks` setting which enables workarounds for
websites with broken user agent parsing (enabled by default, see the "Fixed"
section for fixed websites).
- New `qt.force_platformtheme` setting to force Qt to use a given platform
theme.
Changed
~~~~~~~

View File

@ -245,6 +245,7 @@
|<<prompt.radius,prompt.radius>>|Rounding radius (in pixels) for the edges of prompts.
|<<qt.args,qt.args>>|Additional arguments to pass to Qt, without leading `--`.
|<<qt.force_platform,qt.force_platform>>|Force a Qt platform to use.
|<<qt.force_platformtheme,qt.force_platformtheme>>|Force a Qt platformtheme to use.
|<<qt.force_software_rendering,qt.force_software_rendering>>|Force software rendering for QtWebEngine.
|<<qt.highdpi,qt.highdpi>>|Turn on Qt HighDPI scaling.
|<<qt.low_end_device_mode,qt.low_end_device_mode>>|When to use Chromium's low-end device mode.
@ -3036,6 +3037,16 @@ Type: <<types,String>>
Default: empty
[[qt.force_platformtheme]]
=== qt.force_platformtheme
Force a Qt platformtheme to use.
This sets the `QT_QPA_PLATFORMTHEME` environment variable which controls dialogs like the filepicker. By default, Qt determines the platform theme based on the desktop environment.
This setting requires a restart.
Type: <<types,String>>
Default: empty
[[qt.force_software_rendering]]
=== qt.force_software_rendering
Force software rendering for QtWebEngine.

View File

@ -178,6 +178,19 @@ qt.force_platform:
This sets the `QT_QPA_PLATFORM` environment variable and is useful to force
using the XCB plugin when running QtWebEngine on Wayland.
qt.force_platformtheme:
type:
name: String
none_ok: true
default: null
restart: true
desc: >-
Force a Qt platformtheme to use.
This sets the `QT_QPA_PLATFORMTHEME` environment variable which controls
dialogs like the filepicker. By default, Qt determines the platform theme
based on the desktop environment.
qt.process_model:
type:
name: String

View File

@ -106,6 +106,8 @@ def _init_envvars() -> None:
if config.val.qt.force_platform is not None:
os.environ['QT_QPA_PLATFORM'] = config.val.qt.force_platform
if config.val.qt.force_platformtheme is not None:
os.environ['QT_QPA_PLATFORMTHEME'] = config.val.qt.force_platformtheme
if config.val.window.hide_decoration:
os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1'

View File

@ -308,6 +308,7 @@ class TestEarlyInit:
('qt.force_software_rendering', 'chromium',
'QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND', '1'),
('qt.force_platform', 'toaster', 'QT_QPA_PLATFORM', 'toaster'),
('qt.force_platformtheme', 'lxde', 'QT_QPA_PLATFORMTHEME', 'lxde'),
('window.hide_decoration', True,
'QT_WAYLAND_DISABLE_WINDOWDECORATION', '1')
])