Allow minimize to tray.
This commit is contained in:
parent
4383dfa5a1
commit
4b2a33493f
|
@ -41,6 +41,8 @@ ApplicationWindow {
|
|||
|
||||
Controller {
|
||||
id: matriqueController
|
||||
|
||||
onToggleWindow: window.visible ? window.hide() : window.show()
|
||||
}
|
||||
|
||||
Popup {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
Controller::Controller(QObject* parent) : QObject(parent) {
|
||||
tray->setIcon(QIcon(":/asset/img/icon.png"));
|
||||
tray->setToolTip("Matrique");
|
||||
trayMenu->addAction("Toggle Window", [=] { emit toggleWindow(); });
|
||||
trayMenu->addAction("Quit", [=] { QApplication::quit(); });
|
||||
tray->setContextMenu(trayMenu);
|
||||
tray->show();
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QMediaPlayer>
|
||||
#include <QMenu>
|
||||
#include <QObject>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QMenu>
|
||||
|
||||
using namespace QMatrixClient;
|
||||
|
||||
|
@ -101,6 +101,7 @@ class Controller : public QObject {
|
|||
void homeserverChanged();
|
||||
void busyChanged();
|
||||
void errorOccured();
|
||||
void toggleWindow();
|
||||
|
||||
public slots:
|
||||
void joinRoom(const QString& alias);
|
||||
|
|
|
@ -23,6 +23,8 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
qRegisterMetaType<MatriqueRoom *>("MatriqueRoom*");
|
||||
qRegisterMetaType<User *>("User*");
|
||||
qRegisterMetaType<MessageEventType>("MessageEventType");
|
||||
|
|
Loading…
Reference in New Issue