Skip to content

Commit

Permalink
Merge pull request #1523 from jkl1337/master
Browse files Browse the repository at this point in the history
Make UI appear on Qt::ApplicationActive for macOS
  • Loading branch information
kaniini authored Nov 22, 2024
2 parents ba31914 + e174b5b commit 0ed6a84
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libaudqt/audqt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <libaudcore/audstrings.h>
#include <libaudcore/i18n.h>
#include <libaudcore/interface.h>
#include <libaudcore/runtime.h>

#include "libaudqt-internal.h"
Expand Down Expand Up @@ -181,10 +182,17 @@ EXPORT void init()
// to use 9 pt in most places so let's try to do the same.
QApplication::setFont(QApplication::font("QMenu"));
#endif
#ifdef Q_OS_MAC // Mac-specific font tweaks
#ifdef Q_OS_MAC
// Mac-specific font tweaks
QApplication::setFont(QApplication::font("QSmallFont"), "QDialog");
QApplication::setFont(QApplication::font("QSmallFont"), "QTreeView");
QApplication::setFont(QApplication::font("QTipLabel"), "QStatusBar");

// Handle MacOS dock activation (AppKit applicationShouldHandleReopen)
QObject::connect(qapp, &QApplication::applicationStateChanged, [](auto state) {
if (state == Qt::ApplicationState::ApplicationActive)
aud_ui_show(true);
});
#endif
}

Expand Down

0 comments on commit 0ed6a84

Please sign in to comment.