mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 02:18:20 -07:00
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:
@@ -2431,7 +2431,7 @@ MainWindow::changeEvent(QEvent *event)
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
auto size = this->centralWidget()->size();
|
||||
QApplication::setFont(QFont(ProgSettings::getFontName(lang_id), 9));
|
||||
QApplication::setFont(ProgSettings::getUIFont());
|
||||
QApplication::processEvents();
|
||||
main_window->centralWidget()->setFixedSize(size);
|
||||
QApplication::processEvents();
|
||||
|
||||
Reference in New Issue
Block a user