1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/src/widget/systemtrayicon.h
novist 95649f2476 Support for theming qTox tray and window icons
This patch adds ability to override qTox window and tray icons with ones from user's desktop theme. Some people prefer keeping tray icons consistent to achieve best looks.

Following theme icons used:
* qtox: general window icon which is also used in taskbar
* qtox-online, qtox-offline, qtox-busy, qtox-away, qtox-invisible, qtox-event: tray icons

If theme icon is not available then default built-in icon will be used.
2015-03-11 13:01:10 +02:00

46 lines
932 B
C++

#ifndef SYSTEMTRAYICON_H
#define SYSTEMTRAYICON_H
#include "systemtrayicon_private.h"
#include <QObject>
class QSystemTrayIcon;
class QMenu;
class SystemTrayIcon : public QObject
{
Q_OBJECT
public:
SystemTrayIcon();
~SystemTrayIcon();
void setContextMenu(QMenu* menu);
void show();
void hide();
void setVisible(bool);
void setIcon(QIcon &icon);
signals:
void activated(QSystemTrayIcon::ActivationReason);
private:
QString extractIconToFile(QIcon icon, QString name="icon");
private:
SystrayBackendType backendType;
QSystemTrayIcon* qtIcon;
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
AppIndicator *unityIndicator;
GtkWidget *unityMenu;
#endif
#ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND
StatusNotifier* statusNotifier;
GtkWidget* snMenu;
#endif
#ifdef ENABLE_SYSTRAY_GTK_BACKEND
GtkStatusIcon* gtkIcon;
GtkWidget* gtkMenu;
#endif
};
#endif // SYSTEMTRAYICON_H