yacreader/YACReaderLibrary/trayicon_controller.h
Luis Ángel San Martín 8e99d9e59f Extract the system tray functionality to its own class
LibraryWindow is already a monster, so we'll try to not make it bigger.
2019-09-21 10:47:01 +02:00

35 lines
568 B
C++

#ifndef TRAYICON_CONTROLLER_H
#define TRAYICON_CONTROLLER_H
#include <QtWidgets>
#include <QSystemTrayIcon>
namespace YACReader {
class TrayIconController : public QObject
{
Q_OBJECT
public:
TrayIconController(QSettings *settings,
QMainWindow *window);
void updateIconVisibility();
bool handleCloseToTrayIcon(QCloseEvent *event);
QSystemTrayIcon trayIcon;
public slots:
void showWindow();
private:
QSettings *settings;
QMainWindow *window;
QMenu *trayIconMenu;
};
}
#endif // TRAYICON_CONTROLLER_H