Refactor delegates and improve context menu opening

This unifies the context menu opening and makes sure that clicking *anywhere* on the delegate opens the context menu, not just on the content
This commit is contained in:
Tobias Fella
2022-07-09 23:36:50 +02:00
parent a75048761b
commit 8257a9d65e
6 changed files with 27 additions and 47 deletions

View File

@@ -26,6 +26,8 @@ TimelineContainer {
property bool supportStreaming: true
readonly property int maxWidth: 1000 // TODO messageListView.width
onOpenContextMenu: openFileContext(model, vid)
onDownloadedChanged: {
if (downloaded) {
vid.source = progressInfo.localPath
@@ -121,16 +123,6 @@ TimelineContainer {
videoDelegate.downloadAndPlay()
}
}
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: openFileContext(model, parent)
}
TapHandler {
acceptedButtons: Qt.LeftButton
onLongPressed: openFileContext(model, parent)
}
}
function downloadAndPlay() {