diff --git a/qml/Room.qml b/qml/Room.qml index de4dd96..b82483b 100644 --- a/qml/Room.qml +++ b/qml/Room.qml @@ -39,7 +39,7 @@ Page { Layout.fillWidth: true Layout.fillHeight: true - currentRoom: roomListForm.currentIndex != -1 ? roomListModel.roomAt(roomListForm.currentIndex) : null + currentRoom: roomListForm.currentRoom } } } diff --git a/qml/form/RoomForm.qml b/qml/form/RoomForm.qml index de35572..76bc613 100644 --- a/qml/form/RoomForm.qml +++ b/qml/form/RoomForm.qml @@ -46,7 +46,7 @@ Item { spacing: 16 ImageStatus { - Layout.preferredWidth: parent.height + Layout.preferredWidth: height Layout.fillHeight: true source: currentRoom && currentRoom.avatarUrl != "" ? "image://mxc/" + currentRoom.avatarUrl : null displayText: currentRoom ? currentRoom.displayName : "" @@ -86,7 +86,7 @@ Item { displayMarginBeginning: 40 displayMarginEnd: 40 verticalLayoutDirection: ListView.BottomToTop - maximumFlickVelocity: 1024 + maximumFlickVelocity: 2048 spacing: 8 model: MessageEventModel{ diff --git a/qml/form/RoomListForm.qml b/qml/form/RoomListForm.qml index ade5c99..f9f09c3 100644 --- a/qml/form/RoomListForm.qml +++ b/qml/form/RoomListForm.qml @@ -11,7 +11,8 @@ import "qrc:/qml/component" Item { property alias listModel: roomListProxyModel.sourceModel - property int currentIndex: roomListProxyModel.mapToSource(listView.currentIndex) + readonly property int currentIndex: roomListProxyModel.mapToSource(listView.currentIndex) + readonly property var currentRoom: currentIndex != -1 ? listModel.roomAt(currentIndex) : null readonly property bool mini: setting.miniMode // Used as an indicator of whether the listform should be displayed as "Mini mode". ColumnLayout { @@ -124,7 +125,7 @@ Item { opacity: 0.2 } highlightMoveDuration: 250 - maximumFlickVelocity: 1024 + maximumFlickVelocity: 2048 currentIndex: -1 @@ -134,6 +135,10 @@ Item { width: parent.width height: 80 onClicked: listView.currentIndex = index + onPressAndHold: { + roomListMenu.roomIndex = index + roomListMenu.popup() + } ToolTip.visible: mini && hovered ToolTip.text: name @@ -196,6 +201,36 @@ Item { color: Material.theme == Material.Light ? "#dbdbdb" : "#363636" } } + + Menu { + property int roomIndex: -1 + readonly property int roomProxyIndex: roomListProxyModel.mapToSource(roomIndex) + readonly property var room: roomProxyIndex != -1 ? listModel.roomAt(roomProxyIndex) : null + + id: roomListMenu + + MenuItem { + text: "Priorize" + onTriggered: { + roomListMenu.room.removeTag("m.lowpriority") + 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") + } + } + MenuItem { + text: "Direct Chat" + onTriggered: saveDialog.open() + } + } } } } diff --git a/qml/main.qml b/qml/main.qml index b11470e..604d6ad 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -28,9 +28,6 @@ ApplicationWindow { Settings.Settings { id: setting - property alias windowWidth: window.width - property alias windowHeight: window.height - property alias homeserver: matriqueController.homeserver property alias userID: matriqueController.userID property alias token: matriqueController.token