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:31:44 +0100
commit86d871038034fe1a627241741e39eceecb12614c (patch)
tree0227eb28c44bb117338029db569d9bf32063c0a8
parentaa43c6a09e93ddd09cd80b9f49898e81357189fa (diff)
downloadqutebrowser-86d871038034fe1a627241741e39eceecb12614c.tar.gz
qutebrowser-86d871038034fe1a627241741e39eceecb12614c.zip
Minor changes to dark color preference
-rw-r--r--qutebrowser/browser/webengine/darkmode.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/browser/webengine/darkmode.py b/qutebrowser/browser/webengine/darkmode.py
index 86b7f8c59..d067edea3 100644
--- a/qutebrowser/browser/webengine/darkmode.py
+++ b/qutebrowser/browser/webengine/darkmode.py
@@ -266,8 +266,12 @@ def settings() -> Iterator[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 1680a838b..74805cec2 100644
--- a/tests/end2end/test_invocations.py
+++ b/tests/end2end/test_invocations.py
@@ -429,6 +429,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 8ff5b95d3..b050113b4 100644
--- a/tests/unit/config/test_qtargs.py
+++ b/tests/unit/config/test_qtargs.py
@@ -290,11 +290,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),