mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
39 lines
634 B
C++
39 lines
634 B
C++
#ifndef TRAYICON_CONTROLLER_H
|
|
#define TRAYICON_CONTROLLER_H
|
|
|
|
#include <QCloseEvent>
|
|
#include <QMenu>
|
|
#include <QSettings>
|
|
#include <QSystemTrayIcon>
|
|
|
|
class LibraryWindow;
|
|
|
|
namespace YACReader {
|
|
|
|
class TrayIconController : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
TrayIconController(QSettings *settings,
|
|
LibraryWindow *window);
|
|
|
|
void updateIconVisibility();
|
|
|
|
bool handleCloseToTrayIcon(QCloseEvent *event);
|
|
|
|
QSystemTrayIcon trayIcon;
|
|
|
|
public slots:
|
|
void showWindow();
|
|
|
|
private:
|
|
QSettings *settings;
|
|
LibraryWindow *window;
|
|
|
|
QMenu *trayIconMenu;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // TRAYICON_CONTROLLER_H
|