Prepare to add priorize and depriorize options.
This commit is contained in:
parent
7837c2d75e
commit
d6a7f8ad8b
|
@ -39,7 +39,7 @@ Page {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
currentRoom: roomListForm.currentIndex != -1 ? roomListModel.roomAt(roomListForm.currentIndex) : null
|
currentRoom: roomListForm.currentRoom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ Item {
|
||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
ImageStatus {
|
ImageStatus {
|
||||||
Layout.preferredWidth: parent.height
|
Layout.preferredWidth: height
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
source: currentRoom && currentRoom.avatarUrl != "" ? "image://mxc/" + currentRoom.avatarUrl : null
|
source: currentRoom && currentRoom.avatarUrl != "" ? "image://mxc/" + currentRoom.avatarUrl : null
|
||||||
displayText: currentRoom ? currentRoom.displayName : ""
|
displayText: currentRoom ? currentRoom.displayName : ""
|
||||||
|
@ -86,7 +86,7 @@ Item {
|
||||||
displayMarginBeginning: 40
|
displayMarginBeginning: 40
|
||||||
displayMarginEnd: 40
|
displayMarginEnd: 40
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
verticalLayoutDirection: ListView.BottomToTop
|
||||||
maximumFlickVelocity: 1024
|
maximumFlickVelocity: 2048
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
model: MessageEventModel{
|
model: MessageEventModel{
|
||||||
|
|
|
@ -11,7 +11,8 @@ import "qrc:/qml/component"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property alias listModel: roomListProxyModel.sourceModel
|
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".
|
readonly property bool mini: setting.miniMode // Used as an indicator of whether the listform should be displayed as "Mini mode".
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
@ -124,7 +125,7 @@ Item {
|
||||||
opacity: 0.2
|
opacity: 0.2
|
||||||
}
|
}
|
||||||
highlightMoveDuration: 250
|
highlightMoveDuration: 250
|
||||||
maximumFlickVelocity: 1024
|
maximumFlickVelocity: 2048
|
||||||
|
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
|
@ -134,6 +135,10 @@ Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 80
|
height: 80
|
||||||
onClicked: listView.currentIndex = index
|
onClicked: listView.currentIndex = index
|
||||||
|
onPressAndHold: {
|
||||||
|
roomListMenu.roomIndex = index
|
||||||
|
roomListMenu.popup()
|
||||||
|
}
|
||||||
|
|
||||||
ToolTip.visible: mini && hovered
|
ToolTip.visible: mini && hovered
|
||||||
ToolTip.text: name
|
ToolTip.text: name
|
||||||
|
@ -196,6 +201,36 @@ Item {
|
||||||
color: Material.theme == Material.Light ? "#dbdbdb" : "#363636"
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,6 @@ ApplicationWindow {
|
||||||
Settings.Settings {
|
Settings.Settings {
|
||||||
id: setting
|
id: setting
|
||||||
|
|
||||||
property alias windowWidth: window.width
|
|
||||||
property alias windowHeight: window.height
|
|
||||||
|
|
||||||
property alias homeserver: matriqueController.homeserver
|
property alias homeserver: matriqueController.homeserver
|
||||||
property alias userID: matriqueController.userID
|
property alias userID: matriqueController.userID
|
||||||
property alias token: matriqueController.token
|
property alias token: matriqueController.token
|
||||||
|
|
Loading…
Reference in New Issue