Make Right Click on Room bring up Context Menu

BUG: 454892
This commit is contained in:
Jan Bidler
2022-06-06 19:38:50 +02:00
parent 014826bd09
commit b44e81c849

View File

@@ -229,14 +229,11 @@ Kirigami.ScrollablePage {
subtitle: subtitleText subtitle: subtitleText
subtitleItem.textFormat: Text.PlainText subtitleItem.textFormat: Text.PlainText
onPressAndHold: { onPressAndHold: {
const menu = roomListContextMenu.createObject(page, {"room": currentRoom}) createRoomListContextMenu()
configButton.visible = true }
configButton.down = true TapHandler {
menu.closed.connect(function() { acceptedButtons: Qt.RightButton
configButton.down = undefined onTapped: createRoomListContextMenu()
configButton.visible = Qt.binding(function() { return roomListItem.hovered || Kirigami.Settings.isMobile })
})
menu.open()
} }
leading: Kirigami.Avatar { leading: Kirigami.Avatar {
@@ -271,6 +268,13 @@ Kirigami.ScrollablePage {
id: optionAction id: optionAction
icon.name: "configure" icon.name: "configure"
onTriggered: { onTriggered: {
createRoomListContextMenu()
}
}
}
}
function createRoomListContextMenu() {
const menu = roomListContextMenu.createObject(page, {"room": currentRoom}) const menu = roomListContextMenu.createObject(page, {"room": currentRoom})
configButton.visible = true configButton.visible = true
configButton.down = true configButton.down = true
@@ -283,9 +287,6 @@ Kirigami.ScrollablePage {
} }
} }
} }
}
}
}
footer: QQC2.ToolBar { footer: QQC2.ToolBar {
visible: accountList.count > 1 && !collapsedMode visible: accountList.count > 1 && !collapsedMode