diff --git a/qml/Room.qml b/qml/Room.qml index b82483b..6cffa7d 100644 --- a/qml/Room.qml +++ b/qml/Room.qml @@ -13,7 +13,7 @@ Page { RoomListModel { id: roomListModel - connection: page.connection + connection: matriqueController.isLogin ? page.connection : undefined onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName) } diff --git a/qml/form/RoomListForm.qml b/qml/form/RoomListForm.qml index f9f09c3..828d125 100644 --- a/qml/form/RoomListForm.qml +++ b/qml/form/RoomListForm.qml @@ -213,22 +213,18 @@ Item { text: "Priorize" onTriggered: { roomListMenu.room.removeTag("m.lowpriority") - roomListMenu.room.addTag("m.favourite") + roomListMenu.room.addTag("m.favourite", "") } } MenuItem { text: "Depriorize" onTriggered: { - console.log("Index:" + roomListMenu.roomIndex) - console.log("Proxy:" + roomListMenu.roomProxyIndex) - console.log("Room:" + roomListMenu.room.displayName) roomListMenu.room.removeTag("m.favourite") - roomListMenu.room.addTag("m.lowpriority") + roomListMenu.room.addTag("m.lowpriority", "") } } MenuItem { text: "Direct Chat" - onTriggered: saveDialog.open() } } } diff --git a/qml/form/SettingAccountForm.qml b/qml/form/SettingAccountForm.qml index 4bdab36..fedb01a 100644 --- a/qml/form/SettingAccountForm.qml +++ b/qml/form/SettingAccountForm.qml @@ -5,31 +5,42 @@ import QtQuick.Layouts 1.3 import "qrc:/qml/component" Page { - RowLayout { - height: 60 + padding: 64 - ImageStatus { - Layout.preferredWidth: height - Layout.fillHeight: true + ColumnLayout { + RowLayout { + Layout.preferredHeight: 60 - source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" - displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N" - opaqueBackground: false + ImageStatus { + Layout.preferredWidth: height + Layout.fillHeight: true + + source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" + displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N" + opaqueBackground: false + } + + ColumnLayout { + Layout.fillWidth: true + Layout.fillHeight: true + + Label { + font.pointSize: 18 + text: connection ? connection.localUser.displayName : "" + } + + Label { + font.pointSize: 12 + text: connection ? connection.localUser.id : "" + } + } } - ColumnLayout { - Layout.fillWidth: true - Layout.fillHeight: true + Button { + text: "Logout" + highlighted: true - Label { - font.pointSize: 18 - text: connection ? connection.localUser.displayName : "" - } - - Label { - font.pointSize: 12 - text: "No text." - } + onClicked: matriqueController.logout() } } } diff --git a/qml/main.qml b/qml/main.qml index 565fc99..c492f8b 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -11,7 +11,7 @@ import "component" import "form" ApplicationWindow { - readonly property var connection: matriqueController.isLogin ? matriqueController.connection : undefined + readonly property var connection: matriqueController.connection id: window visible: true