-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtray.hpp
46 lines (36 loc) · 943 Bytes
/
tray.hpp
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
44
45
46
#ifndef TRAY_H
#define TRAY_H
#include <string>
#include <vector>
#include <functional>
namespace Tray
{
struct TrayMenu
{
std::string text = "";
bool isEnabled = true;
bool isChecked = false;
bool hasCheckbox = false; // Only used with linux/libAppIndicator. Whether the entry even has a checkbox
std::function<void(TrayMenu*)> onClicked = nullptr;
std::vector<TrayMenu*> subMenu;
};
struct TrayIcon
{
std::string iconFilePng = ""; // OSX, Linux. File name of icon (same folder as execution dir)
std::string iconFileIco = ""; // Windows. File name of icon (same folder as execution dir)
std::string tooltip = ""; // Only used on Windows, hover tooltip
std::vector<TrayMenu*> menu;
};
class TrayMaker
{
private:
TrayIcon* trayIcon;
public:
bool Initialize(TrayIcon* toInitialize);
bool Loop(bool blocking);
void Update();
void Exit();
};
static TrayMaker trayMaker;
}
#endif /* TRAY_H */