Apply selected style to window elements on macOS

Qt doesn't apply the proper style to elements such as the title bar or text shadows, so this must be done in native code.

Signed-off-by: Kenneth Chew <79120643+kthchew@users.noreply.github.com>
This commit is contained in:
Kenneth Chew
2025-07-16 00:28:28 -04:00
parent 0dbaeef8a6
commit 3e65d3a9b5
4 changed files with 91 additions and 0 deletions

View File

@@ -81,6 +81,15 @@ class ThemeManager {
void initializeIcons();
void initializeWidgets();
// On non-Mac systems, this is a no-op.
void setTitlebarColorOnMac(WId windowId, QColor color);
// This also will set the titlebar color of newly opened windows after this method is called.
// On non-Mac systems, this is a no-op.
void setTitlebarColorOfAllWindowsOnMac(QColor color);
#ifdef Q_OS_MACOS
NSObject* m_windowTitlebarObserver = nullptr;
#endif
const QStringList builtinIcons{ "pe_colored", "pe_light", "pe_dark", "pe_blue", "breeze_light", "breeze_dark",
"OSX", "iOS", "flat", "flat_white", "multimc" };
};