diff --git a/qml/component/MessageDelegate.qml b/qml/component/MessageDelegate.qml index 9e91313..cd1d450 100644 --- a/qml/component/MessageDelegate.qml +++ b/qml/component/MessageDelegate.qml @@ -7,7 +7,7 @@ import Matrique.Settings 0.1 import "qrc:/js/util.js" as Util RowLayout { - readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote") + readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other") readonly property bool highlighted: !(sentByMe || eventType === "notice" ) readonly property bool sentByMe: author === currentRoom.localUser readonly property bool isText: eventType === "notice" || eventType === "message" diff --git a/qml/form/RoomForm.qml b/qml/form/RoomForm.qml index fdd0094..a3c5875 100644 --- a/qml/form/RoomForm.qml +++ b/qml/form/RoomForm.qml @@ -409,6 +409,8 @@ Item { parent: ApplicationWindow.overlay + Material.elevation: 2 + textArea: inputField } } diff --git a/qml/main.qml b/qml/main.qml index 6e46b2d..3c1b8c1 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -33,16 +33,12 @@ ApplicationWindow { Controller { id: matriqueController - onToggleWindow: { - console.log("Activating window...") - if (window.visible) { - window.hide() - } else { - window.show() - window.raise() - window.requestActivate() - } + onShowWindow: { + window.show() + window.raise() + window.requestActivate() } + onHideWindow: window.hide() } AccountListModel { diff --git a/src/controller.cpp b/src/controller.cpp index 52c7f2e..e1027c3 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -31,10 +31,10 @@ Controller::Controller(QObject* parent) : QObject(parent) { tray->setToolTip("Matrique"); connect(tray, &QSystemTrayIcon::activated, [this](QSystemTrayIcon::ActivationReason r) { - if (r != QSystemTrayIcon::Context) emit toggleWindow(); + if (r != QSystemTrayIcon::Context) emit showWindow(); }); - connect(tray, &QSystemTrayIcon::messageClicked, [=] { emit toggleWindow(); }); - trayMenu->addAction("Toggle Window", [=] { emit toggleWindow(); }); + connect(tray, &QSystemTrayIcon::messageClicked, [=] { emit showWindow(); }); + trayMenu->addAction("Hide Window", [=] { emit hideWindow(); }); trayMenu->addAction("Quit", [=] { QApplication::quit(); }); tray->setContextMenu(trayMenu); tray->show(); @@ -168,7 +168,7 @@ bool Controller::saveAccessToken(const AccountSettings& account, auto fileDir = QFileInfo(accountTokenFile).dir(); if (!((fileDir.exists() || fileDir.mkpath(".")) && accountTokenFile.open(QFile::WriteOnly))) { - emit errorOccured(); + emit errorOccured("Cannot save access token."); } else { // Try to restrict access rights to the file. The below is useless // on Windows: FAT doesn't control access at all and NTFS is diff --git a/src/controller.h b/src/controller.h index 8f30954..29136d2 100644 --- a/src/controller.h +++ b/src/controller.h @@ -66,8 +66,9 @@ class Controller : public QObject { signals: void busyChanged(); - void errorOccured(); - void toggleWindow(); + void errorOccured(QString error); + void showWindow(); + void hideWindow(); void connectionAdded(Connection* conn); void connectionDropped(Connection* conn); void initiated();