-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem_tray.h
43 lines (36 loc) · 1007 Bytes
/
system_tray.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef SYSTEM_TRAY_H
#define SYSTEM_TRAY_H
#include <QObject>
#include <QIcon>
#include <QSystemTrayIcon>
#include <QQuickWindow>
#include <QQmlApplicationEngine>
#include <QJsonArray>
class QMenu;
class QAction;
class SystemTray : public QObject
{
Q_OBJECT
public:
explicit SystemTray(QObject *parent = nullptr);
~SystemTray();
void setIcon(QIcon icon);
void setEngine(QQmlApplicationEngine* engine);
void setJsonProfiles(QJsonArray profiles, QString current);
signals:
void close();
void profileSelected(QString name);
void showMainWindow();
public slots:
void setVisible(bool visible = true);
void activatedSystemTray(QSystemTrayIcon::ActivationReason reason);
protected:
QSystemTrayIcon* mTrayIcon;
QMenu* mMenu;
QAction* mQuitAction;
QAction* mAppBanner;
QMenu* mProfileMenu;
protected slots:
void handleProfileSelect(bool checked);
};
#endif // SYSTEM_TRAY_H