Skip to content
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 QMenu font (Segoe UI) for entire application #8632

Merged
merged 1 commit into from Feb 17, 2020

Conversation

nyanpasu64
Copy link
Contributor

@nyanpasu64 nyanpasu64 commented Feb 17, 2020

On Windows, Qt's default system font (MS Shell Dlg 2) is outdated.

Dolphin previously used over 15 lines of code to compute a font closer to the proper font, but with an approximately correct font size. Using the QMenu font directly is both more concise and more elegant (in my opinion).

Successor to #8359.

Credit to https://stackoverflow.com/a/40380684 for discovering this method. Is it worth crediting in the source code? I think not?

@CookiePLMonster
Copy link
Contributor

Please provide before/after comparison screenshots.

@nyanpasu64
Copy link
Contributor Author

Please provide before/after comparison screenshots.

It seems to be visually indistinguishable in the English locale, for fonts at the default size. There may be slight differences in other locales, or parts of the UI using differently sized fonts (but I can't find any, even in the GC/Wiimote controller viewers).

Master:
master

PR:
pr

TBH I'm mostly doing this as a proof of concept. Dolphin already has modern fonts on Windows, so this is primarily a code cleanup. However many other Qt-based programs are still stuck on MS Shell Dlg 2, and would benefit more from this method. (Credit to https://stackoverflow.com/a/40380684 for discovering this method.)

@nyanpasu64 nyanpasu64 marked this pull request as ready for review February 17, 2020 09:31
@MayImilae
Copy link
Contributor

Wow that looks exactly the same. I guess it isn't something I need to worry about!

Copy link
Contributor

@spycrab spycrab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from one minor note.
(Just to be sure I tried it on a HiDPI Monitor. No differences there either.)

Source/Core/DolphinQt/Main.cpp Show resolved Hide resolved
On Windows, Qt's default system font (MS Shell Dlg 2) is outdated.

Dolphin previously used over 15 lines of code to compute a font
closer to the proper font, but with an approximately correct font size.
Using the QMenu font directly is both more concise and more elegant
(in my opinion).
@nyanpasu64
Copy link
Contributor Author

nyanpasu64 commented Feb 17, 2020

QApplication::font("QMenu") traces down to https://code.woboq.org/qt5/qtbase/src/plugins/platforms/windows/qwindowstheme.cpp.html#505 which uses lfMenuFont. I don't know if I can really document this in the code though. (Sidenote: Qt's font handling is special, extremely complex, and has some unexpected properties especially on KDE.)

@spycrab spycrab merged commit 2d6a72e into dolphin-emu:master Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants