Query UI font from system on Windows

Previously, we determined the UI font from a predefined set of fonts
each mapped to a language. This works well if the user doesn't change
their Windows UI font, but if one does, they will get the default UI
font associated with their language instead of the one the set.

This commit replaces ProgSettings::getFontName with
ProgSettings::getUIFont, which uses the SystemParametersInfo API to
query the message font from the system, which will allow users to have a
custom font. It will also not interfere with different languages, as the
message font will be appropriately set by default there.
This commit is contained in:
aubymori
2026-02-02 19:15:31 -06:00
parent b7075922ac
commit 7f69f00ed2
6 changed files with 42 additions and 24 deletions

View File

@@ -269,7 +269,7 @@ VMManagerMainWindow::changeEvent(QEvent *event)
{
#ifdef Q_OS_WINDOWS
if (event->type() == QEvent::LanguageChange) {
QApplication::setFont(QFont(ProgSettings::getFontName(lang_id), 9));
QApplication::setFont(QFont(ProgSettings::getUIFont()));
}
#endif
QWidget::changeEvent(event);