Closed atauzki closed 2 months ago
And I also tried the latest version on Github, it takes no effect before relaunching the program or make a word query.
I don't have time right now due to exams in the following weeks.
However, these are my guesses:
chrome://flags/#enable-force-dark
)dark-reader.js
which is almost 2 years behind
https://github.com/xiaoyifang/goldendict-ng/pull/1452
@atauzki can you help to try this PR?
background and text in welcome page dont change to black before query or restart just like before.
I guess the reason is that the welcome page does not refresh when the dark mode setting changes
I tried all configurations other than on Windows. I cannot reproduce in any way.
Maybe you have local article-style.css
affecting it?
article-style.css
.mdict + .mdict {
margin-top: 20px
}
.mwiki {
font-size: 14px
}
compiled last code, and comment these code, still reproducable.
Don't screenshot code my friend, just copy and paste 🫠🫠🫠🫠ðŸ«
I will check it when I can access a Windows machine today.
I still cannot reproduce, the article-style.css is inserted.
Maybe a bug of re-release Qt6.7? This issue was opened when Qt6.7 was not yet released.
I tried 6.6.2 build on github action build on Mar 31, the day I proposed this issue. And qt 6.7.0 action is not completed that time. In 6.6.2, the welcome page has no change at all after turn on the dark reader mode until restart. (not portable mode, so no extra config takes effect) Maybe the background change affected 6.7.0 but doesn't affect 6.6.2. Then I inspected the page shows darkreader.js doesn't loads until restart in both version.
This problem is super weird.
Set a breakpoint here: https://github.com/xiaoyifang/goldendict-ng/blob/fb91eba36f90ee31a2c40936b0323834780310ef/src/ui/mainwindow.cc#L2277-L2283
view.currentWord is "welcome!", so the right widget got picked up.
needReload is true, the webview's reload is called.
Manually calling view.reload();
is debugger -> won't trigger reload. The reload
is called, but LocalSchemeHandler::requestStarted
will not be triggered (????)
However, when switching dark mode on and off, you can rigger reload inside the browser's inspector by calling location.reload()
in JavaScript and the welcome
page will successfully reload and dark theme will be correctly set. (????)
All other pages other than welcome are OK.
Fixed.
try with latest source code
The version I used is compiled with qt6.7.0: https://cloud.freemdict.com/index.php/s/psF3GZstsYZ3JZc
step:
This is the screenshort: https://github.com/xiaoyifang/goldendict-ng/assets/19769843/26695d63-5a8d-4855-9d90-96970d2b8927