Add basic room upgrade support.
Add full screen image view. Fix a bug in image provider.
This commit is contained in:
@@ -36,8 +36,8 @@ Item {
|
||||
visible: !realSource || image.status != Image.Ready
|
||||
|
||||
radius: height / 2
|
||||
|
||||
color: stringToColor(hint)
|
||||
antialiasing: true
|
||||
|
||||
Label {
|
||||
anchors.centerIn: parent
|
||||
|
||||
41
imports/Spectral/Component/FullScreenImage.qml
Normal file
41
imports/Spectral/Component/FullScreenImage.qml
Normal file
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
ApplicationWindow {
|
||||
property url imageUrl
|
||||
property int sourceWidth
|
||||
property int sourceHeight
|
||||
|
||||
id: root
|
||||
|
||||
flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground
|
||||
visible: true
|
||||
visibility: Qt.WindowFullScreen
|
||||
|
||||
title: "Image View - " + imageUrl
|
||||
|
||||
color: "#BB000000"
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
|
||||
sourceSize.width: root.sourceWidth
|
||||
sourceSize.height: root.sourceHeight
|
||||
source: imageUrl
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
|
||||
width: 64
|
||||
height: 64
|
||||
|
||||
contentItem: MaterialIcon {
|
||||
icon: "\ue5cd"
|
||||
color: "white"
|
||||
}
|
||||
|
||||
onClicked: root.close()
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -7,3 +7,4 @@ AutoListView 2.0 AutoListView.qml
|
||||
AutoTextField 2.0 AutoTextField.qml
|
||||
SplitView 2.0 SplitView.qml
|
||||
Avatar 2.0 Avatar.qml
|
||||
FullScreenImage 2.0 FullScreenImage.qml
|
||||
|
||||
Reference in New Issue
Block a user