mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #8632 from jimbo1qaz/windows-menu-font
Windows GUI: Use QMenu font (Segoe UI) for entire application
This commit is contained in:
@ -101,27 +101,12 @@ int main(int argc, char* argv[])
|
|||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Get the default system font because Qt's way of obtaining it is outdated
|
// On Windows, Qt 5's default system font (MS Shell Dlg 2) is outdated.
|
||||||
NONCLIENTMETRICSW metrics = {};
|
// Interestingly, the QMenu font is correct and comes from lfMenuFont
|
||||||
LOGFONTW& logfont = metrics.lfMenuFont;
|
// (Segoe UI on English computers).
|
||||||
metrics.cbSize = sizeof(metrics);
|
// So use it for the entire application.
|
||||||
|
// This code will become unnecessary and obsolete once we switch to Qt 6.
|
||||||
if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0))
|
QApplication::setFont(QApplication::font("QMenu"));
|
||||||
{
|
|
||||||
// Sadly Qt 5 doesn't support turning a native font handle into a QFont so this is the next best
|
|
||||||
// thing
|
|
||||||
QFont font = QApplication::font();
|
|
||||||
font.setFamily(QString::fromStdWString(logfont.lfFaceName));
|
|
||||||
|
|
||||||
font.setItalic(logfont.lfItalic);
|
|
||||||
font.setStrikeOut(logfont.lfStrikeOut);
|
|
||||||
font.setUnderline(logfont.lfUnderline);
|
|
||||||
|
|
||||||
// The default font size is a bit too small
|
|
||||||
font.setPointSize(QFontInfo(font).pointSize() * 1.2);
|
|
||||||
|
|
||||||
QApplication::setFont(font);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
|
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
|
||||||
|
Reference in New Issue
Block a user