mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add better icons for the system tray in macos and windows
I would like to design specific icons for the system tray at some point, but for now this is what we have.
This commit is contained in:
parent
4377ad935c
commit
6031c81d81
@ -71,5 +71,6 @@
|
||||
<file alias="images/sidebar/delete_sidebar@2x.png">../images/sidebar/delete_sidebar_osx@2x.png</file>
|
||||
<file alias="images/sidebar/addLabelIcon@2x.png">../images/sidebar/addLabelIcon_osx@2x.png</file>
|
||||
<file alias="images/sidebar/renameListIcon@2x.png">../images/sidebar/renameListIcon_osx@2x.png</file>
|
||||
<file>YACReaderLibrary.icns</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -41,5 +41,6 @@
|
||||
<file>../images/lists/label_yellow.png</file>
|
||||
<file>../images/lists/list.png</file>
|
||||
<file>../images/empty_reading_list.png</file>
|
||||
<file>icon.ico</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -143,13 +143,20 @@ void LibraryWindow::setupUI()
|
||||
// If a window icon was set in main() we reuse it for the tray too.
|
||||
// This allows support for third party icon themes on Freedesktop(Linux/Unix)
|
||||
// systems.
|
||||
// TODO: Luis, please tweak this to your liking and add OS macros if needed.
|
||||
if (!QApplication::windowIcon().isNull()) {
|
||||
trayIcon.setIcon(QApplication::windowIcon());
|
||||
} else {
|
||||
// TODO: Luis: This is a placeholder. Add MacOS, Windows and maybe a fallback
|
||||
// for other systems here.
|
||||
#ifdef Q_OS_WIN
|
||||
trayIcon.setIcon(QIcon(":/icon.ico"));
|
||||
#else
|
||||
#ifdef Q_OS_MACOS
|
||||
auto icon = QIcon(":/YACReaderLibrary.icns");
|
||||
icon.setIsMask(true);
|
||||
trayIcon.setIcon(icon);
|
||||
#else
|
||||
trayIcon.setIcon(QIcon(":/images/iconLibrary.png"));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
connect(&trayIcon, &QSystemTrayIcon::activated,
|
||||
|
Loading…
Reference in New Issue
Block a user