Add basic room upgrade support.

Add full screen image view.
Fix a bug in image provider.
This commit is contained in:
Black Hat
2019-04-23 10:57:35 +08:00
parent 11ede88abc
commit 2565b8ba79
9 changed files with 177 additions and 6 deletions

View File

@@ -83,10 +83,13 @@ ColumnLayout {
id: img
source: "image://mxc/" +
(content.info && content.info.thumbnail_info ?
content.thumbnailMediaId : content.mediaId)
sourceSize.width: messageListView.width * 0.6
sourceSize.height: messageListView.height
(content.info && content.info.thumbnail_info ?
content.thumbnailMediaId : content.mediaId)
sourceSize.width: 720
sourceSize.height: 720
fillMode: Image.PreserveAspectCrop
layer.enabled: true
layer.effect: OpacityMask {
@@ -97,6 +100,16 @@ ColumnLayout {
}
}
Component {
id: fullScreenImage
FullScreenImage {
imageUrl: "image://mxc/" + content.mediaId
sourceWidth: content.info.w
sourceHeight: content.info.h
}
}
Rectangle {
anchors.fill: parent
@@ -113,6 +126,11 @@ ColumnLayout {
id: messageMouseArea
onPrimaryClicked: {
var window = fullScreenImage.createObject()
window.show()
}
onSecondaryClicked: messageContextMenu.popup()
Menu {
@@ -126,16 +144,19 @@ ColumnLayout {
sourceDialog.open()
}
}
MenuItem {
text: "Open Externally"
onTriggered: downloadAndOpen()
}
MenuItem {
text: "Save As"
onTriggered: saveFileAs()
}
MenuItem {
text: "Reply"
@@ -147,6 +168,7 @@ ColumnLayout {
roomPanelInput.focus()
}
}
MenuItem {
text: "Redact"