summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-12-03 14:31:44 +0100
committerFlorian Bruhin <me@the-compiler.org>2020-12-03 14:53:55 +0100
commit0de0451d6bfdea830fc5bd79ff538f6624e7cde3 (patch)
tree9b4dc3ff6256f67abc91783482bb3254323caa23
parent922c8c86c47651cee1c228f35f7837ce4ea1b404 (diff)
downloadqutebrowser-0de0451d6bfdea830fc5bd79ff538f6624e7cde3.tar.gz
qutebrowser-0de0451d6bfdea830fc5bd79ff538f6624e7cde3.zip
Minor changes to dark color preference
(cherry picked from commit 86d871038034fe1a627241741e39eceecb12614c)
-rw-r--r--qutebrowser/config/qtargs.py8
-rw-r--r--tests/end2end/test_invocations.py3
-rw-r--r--tests/unit/config/test_qtargs.py5
3 files changed, 10 insertions, 6 deletions
diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py
index 0afea7196..06df54a2f 100644
--- a/qutebrowser/config/qtargs.py
+++ b/qutebrowser/config/qtargs.py
@@ -81,8 +81,12 @@ def _darkmode_settings() -> typing.Iterator[typing.Tuple[str, str]]:
"""Get necessary blink settings to configure dark mode for QtWebEngine."""
if (qtutils.version_check('5.15.2', compiled=False) and
config.val.colors.webpage.prefers_color_scheme_dark):
- # In future versions of 'blink', (> Qt 5.15.2) the enumeration has
- # changed and this will need to be set to '0' instead.
+ # With older Qt versions, this is passed in qtargs.py as --force-dark-mode
+ # instead.
+ #
+ # With Chromium 85 (> Qt 5.15.2), the enumeration has changed in Blink and this
+ # will need to be set to '0' instead:
+ # https://chromium-review.googlesource.com/c/chromium/src/+/2232922
yield "preferredColorScheme", "1"
if not config.val.colors.webpage.darkmode.enabled:
diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py
index 03b6b798f..8460c888c 100644
--- a/tests/end2end/test_invocations.py
+++ b/tests/end2end/test_invocations.py
@@ -417,6 +417,5 @@ def test_preferred_colorscheme(request, quteproc_new):
]
quteproc_new.start(args)
- quteproc_new.send_cmd(':jseval '
- 'matchMedia("(prefers-color-scheme: dark)").matches')
+ quteproc_new.send_cmd(':jseval matchMedia("(prefers-color-scheme: dark)").matches')
quteproc_new.wait_for(message='True')
diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py
index 782444da6..718ffff9b 100644
--- a/tests/unit/config/test_qtargs.py
+++ b/tests/unit/config/test_qtargs.py
@@ -318,11 +318,12 @@ class TestQtArgs:
assert arg in args
@pytest.mark.parametrize('dark, qt_version, added', [
- (True, "5.13", False),
+ (True, "5.13", False), # not supported
(True, "5.14", True),
(True, "5.15.0", True),
(True, "5.15.1", True),
- (True, "5.15.2", False),
+ (True, "5.15.2", False), # handled via blink setting
+
(False, "5.13", False),
(False, "5.14", False),
(False, "5.15.0", False),