QtPass 1.7.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
trayicon.h
1// SPDX-FileCopyrightText: 2015 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#ifndef SRC_TRAYICON_H_
4#define SRC_TRAYICON_H_
5
6#include <QSystemTrayIcon>
7#include <QWidget>
8
9class QAction;
10class QMainWindow;
11class QMenu;
12
17class TrayIcon : public QWidget {
18 Q_OBJECT
19
20public:
25 explicit TrayIcon(QMainWindow *parent);
26
33 void showMessage(const QString &title, const QString &msg, int time);
34
39 void setVisible(bool visible);
40
45 auto getIsAllocated() -> bool;
46
47signals:
48
49public slots:
54
59 void iconActivated(QSystemTrayIcon::ActivationReason reason);
60
61private:
62 void createActions();
63 void createTrayIcon();
64
65 QAction *showAction;
66 QAction *hideAction;
67 QAction *minimizeAction;
68 QAction *maximizeAction;
69 QAction *restoreAction;
70 QAction *quitAction;
71
72 QSystemTrayIcon *sysTrayIcon;
73 QMenu *trayIconMenu;
74 QMainWindow *parentwin;
75
76 bool isAllocated;
77};
78
79#endif // SRC_TRAYICON_H_
void showHideParent()
Toggle the visibility of the associated main window.
void iconActivated(QSystemTrayIcon::ActivationReason reason)
Handle activation events from the system tray icon.
void showMessage(const QString &title, const QString &msg, int time)
Display a transient notification message via the tray icon.
TrayIcon(QMainWindow *parent)
Construct a TrayIcon associated with the given main window.
void setVisible(bool visible)
Show or hide the tray icon and its associated UI.
auto getIsAllocated() -> bool
Check whether tray resources have been allocated and initialized.