Add context menu for image message.

This commit is contained in:
Black Hat 2018-08-03 07:15:42 +08:00
parent b1fba8a8db
commit ca5735d000
1 changed files with 15 additions and 2 deletions

View File

@ -28,12 +28,25 @@ AvatarContainer {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
propagateComposedEvents: true propagateComposedEvents: true
ToolTip.visible: containsMouse ToolTip.visible: containsMouse
ToolTip.text: content.body ToolTip.text: content.body
onClicked: mouse.button & Qt.LeftButton ? downloadable.downloadAndOpen() : downloadable.saveFileAs() onClicked: downloadable.downloadAndOpen()
onPressAndHold: messageImageMenu.popup()
}
Menu {
id: messageImageMenu
MenuItem {
text: "View"
onTriggered: downloadable.downloadAndOpen()
}
MenuItem {
text: "Save as..."
onTriggered: downloadable.saveFileAs()
}
} }
} }
} }