Remove context menu Loader && disable highlight resize animation for
ListView(#6).
This commit is contained in:
parent
e0158daf07
commit
085601f650
|
@ -24,10 +24,7 @@ Item {
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressAndHold: {
|
onPressAndHold: menuComponent.createObject(this)
|
||||||
menuLoader.sourceComponent = menuComponent
|
|
||||||
menuLoader.item.popup()
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: menuComponent
|
id: menuComponent
|
||||||
|
@ -57,12 +54,10 @@ Item {
|
||||||
text: "Redact"
|
text: "Redact"
|
||||||
onTriggered: currentRoom.redactEvent(eventId)
|
onTriggered: currentRoom.redactEvent(eventId)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
Component.onCompleted: popup()
|
||||||
id: menuLoader
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
|
@ -112,7 +112,6 @@ Item {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -125,6 +124,7 @@ Item {
|
||||||
opacity: 0.2
|
opacity: 0.2
|
||||||
}
|
}
|
||||||
highlightMoveDuration: 250
|
highlightMoveDuration: 250
|
||||||
|
highlightResizeDuration: 0
|
||||||
|
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
|
@ -135,11 +135,8 @@ Item {
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 80
|
height: 80
|
||||||
onClicked: listView.currentIndex = index
|
onPressed: listView.currentIndex = index
|
||||||
onPressAndHold: {
|
onPressAndHold: menuComponent.createObject(this)
|
||||||
roomListMenu.roomIndex = index
|
|
||||||
roomListMenu.popup()
|
|
||||||
}
|
|
||||||
|
|
||||||
ToolTip.visible: mini && hovered
|
ToolTip.visible: mini && hovered
|
||||||
ToolTip.text: name
|
ToolTip.text: name
|
||||||
|
@ -184,6 +181,33 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: menuComponent
|
||||||
|
Menu {
|
||||||
|
id: roomListMenu
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
text: "Favourite"
|
||||||
|
checkable: true
|
||||||
|
checked: currentRoom.isFavourite
|
||||||
|
onTriggered: currentRoom.isFavourite ? currentRoom.removeTag("m.favourite") : currentRoom.addTag("m.favourite", "1")
|
||||||
|
}
|
||||||
|
MenuItem {
|
||||||
|
text: "Deprioritize"
|
||||||
|
checkable: true
|
||||||
|
checked: currentRoom.isLowPriority
|
||||||
|
onTriggered: currentRoom.isLowPriority ? currentRoom.removeTag("m.lowpriority") : currentRoom.addTag("m.lowpriority", "1")
|
||||||
|
}
|
||||||
|
MenuSeparator {}
|
||||||
|
MenuItem {
|
||||||
|
text: "Leave Room"
|
||||||
|
onTriggered: matriqueController.forgetRoom(currentRoom.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: popup()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
section.property: "category"
|
section.property: "category"
|
||||||
|
@ -202,32 +226,6 @@ 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: "Favourite"
|
|
||||||
checkable: true
|
|
||||||
checked: roomListMenu.room && roomListMenu.room.isFavourite
|
|
||||||
onTriggered: roomListMenu.room.isFavourite ? roomListMenu.room.removeTag("m.favourite") : roomListMenu.room.addTag("m.favourite", "1")
|
|
||||||
}
|
|
||||||
MenuItem {
|
|
||||||
text: "Deprioritize"
|
|
||||||
checkable: true
|
|
||||||
checked: roomListMenu.room && roomListMenu.room.isLowPriority
|
|
||||||
onTriggered: roomListMenu.room.isLowPriority ? roomListMenu.room.removeTag("m.lowpriority") : roomListMenu.room.addTag("m.lowpriority", "1")
|
|
||||||
}
|
|
||||||
MenuSeparator {}
|
|
||||||
MenuItem {
|
|
||||||
text: "Leave Room"
|
|
||||||
onTriggered: matriqueController.forgetRoom(roomListMenu.room.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue