File tree Expand file tree Collapse file tree 6 files changed +50
-1
lines changed
Expand file tree Collapse file tree 6 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 44 <file>img/app/flameshot.svg</file>
55 <file>img/app/org.flameshot.Flameshot.png</file>
66 <file>img/app/flameshot.png</file>
7+ <file>img/app/flameshot.mask.png</file>
8+ <file>img/app/flameshot.mask.svg</file>
79 <file>img/app/flameshot.monochrome.png</file>
810 <file>img/app/flameshot.monochrome.svg</file>
911 <file>img/app/keyboard.svg</file>
Original file line number Diff line number Diff line change 55#include < QApplication>
66#include < QFontMetrics>
77
8+ #if defined(Q_OS_MACOS)
9+ #include < QOperatingSystemVersion>
10+ #endif
11+
812int GlobalValues::buttonBaseSize ()
913{
1014 return QFontMetrics (qApp->font ()).lineSpacing () * 2.2 ;
@@ -33,3 +37,21 @@ QString GlobalValues::iconPathPNG()
3337 return { " :img/app/flameshot.png" };
3438#endif
3539}
40+
41+ QString GlobalValues::trayIconPath ()
42+ {
43+ #if USE_MONOCHROME_ICON
44+ #if defined(Q_OS_MACOS)
45+ auto currentMacOsVersion = QOperatingSystemVersion::current ();
46+ if (currentMacOsVersion >= QOperatingSystemVersion::MacOSBigSur) {
47+ return { " :img/app/flameshot.mask.png" };
48+ } else {
49+ return { " :img/app/flameshot.monochrome.png" };
50+ }
51+ #else
52+ return { " :img/app/flameshot.monochrome.png" };
53+ #endif
54+ #else
55+ return { " :img/app/flameshot.png" };
56+ #endif
57+ }
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ int buttonBaseSize();
1111QString versionInfo ();
1212QString iconPath ();
1313QString iconPathPNG ();
14+ QString trayIconPath ();
1415}
Original file line number Diff line number Diff line change @@ -33,7 +33,14 @@ TrayIcon::TrayIcon(QObject* parent)
3333 setContextMenu (m_menu);
3434#endif
3535 QIcon icon =
36- QIcon::fromTheme (" flameshot-tray" , QIcon (GlobalValues::iconPathPNG ()));
36+ QIcon::fromTheme (" flameshot-tray" , QIcon (GlobalValues::trayIconPath ()));
37+
38+ #if defined(Q_OS_MACOS)
39+ if (currentMacOsVersion >= QOperatingSystemVersion::MacOSBigSur) {
40+ icon.setIsMask (true );
41+ }
42+ #endif
43+
3744 setIcon (icon);
3845
3946#if defined(Q_OS_MACOS)
You can’t perform that action at this time.
0 commit comments