-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows GUI: Use Edge WebView2 for HTML/Graph view #873
Conversation
629a5a6
to
5f7a0c2
Compare
Tried updating the installer and packaging scripts. @JeromeMartinez Now on your side only need to do the following for this PR:
I can help check/test the installer and 7z when there is a dev snapshot for this PR. |
Tested locally built installer with this PR. It works as expected on Windows 11 including the uninstallation. Also tested on Windows 7 VM. Without Edge WebView2 Runtime installed: With Edge WebView2 Runtime installed: @JeromeMartinez remember the bug in #853 (comment)? This bug is more serious in Windows 7 where it pops up the following: The good news is that with Edge WebView2 Runtime installed, this bug does not happen. |
@cjee21 sorry to be late on this one, but still on my radar, please be patient, ~10 days before we have more time. |
dba64a1
to
1698948
Compare
Just realized Graph view is using HTML too so implemented WebView2 for that too. Tested. Note: Graph view does not have dark mode. |
True... HTML code is mixed in C++ code in https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Export/Export_Graph.cpp , we need to add an option to the library for indicating that we want a dark version... |
Ideally, we should put all styles in all generated HTMLs in <style> tags and add a prefers-color-scheme CSS media query in there. However, we have issues getting the WebView2 to recognize that the app is in dark mode, hence the need for the current workaround with injecting <style> tag. |
True. Maybe better to do that and then hack in the GUI for selecting the right style dynamically. |
I give up (at least for now). Can't really understand that file and didn't see where to change the background of the generated SVG. For the HTML part of graph view, it seems is not in that file but is in |
179b33c
to
5b8dc69
Compare
Am I understanding correctly that Windows 7 support is dropped after this? Does that mean we can drop support for IE engine too?
|
Ugly typo, it was expected to be RHEL/CentOS 7 (no Windows). @g-maxime sorry to ask that but could you send another PR with removal of "Windows " and rebuild? Sorry of the typo... |
Windows 7 is too much used for being dropped. |
520ae39
to
a56f592
Compare
New version of HTML dark mode implementation. Works with the new PR of MediaInfoLib. Now both WebView2 and IE supports dark mode and has almost identical rendering. WebView2 theme switching and dark mode display is more or less perfect. Screenshots:
Remaining bugs:
|
Testing procedure:
|
@cjee21 would you mind to share the exported SVG? I would like to diff them and it seems that I can not reproduce a differnece on my side. |
I made typing mistake in above post. Edited. They are actually exported SVGs, not screenshots. Just save them. |
Oops, I didn't check the extension. |
Looks like that graphviz keeps the same police size whatever is the width in pixels, and the width changes with DPI change. |
71fd459
to
c53f57b
Compare
Rebased and 64-bit support added |
c53f57b
to
53dae63
Compare
@cjee21 please rebase. |
Use Edge WebView2 for HTML and Graph view when available else fallback to IE.
Enable use of WebView2 native dark mode for HTML and Graph views.
Looks okay other than |
|
Confirmed no longer reproducible with Graph Plugin 24.11 on Windows 11 although the graph looks more condensed now. |
Use Edge WebView2 for HTML and Graph view when available else fallback to IE.
This should work on Windows 7 to 11 both with and without Edge WebView2 Runtime installed.
Additional changes beyond this PR that are required to get WebView2 working:
EdgeView2 SDK 1.0.1054.31 by Microsoft
orEdgeView2 SDK 1.0.2739.1 by Microsoft
fromGetIt Package Manager
inC++Builder
.Commits details:
Template.html
for Graph view that enables dark modeTemplate.html
once the repo for it is up since it is understood that it will be.(EDIT: Let's just put the file here: Template.zip)
.nsi
to includeWebView2Loader.dll
in install directory on install and remove it on uninstall.%APPDATA%\MediaInfo
in typical installations (with read-only install dir) and will be left there on uninstall along with the Plugin folder..bat
files to includeWebView2Loader.dll
in the 7z archives.Additional notes:
WebView2Loader.dll
.