diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml
index 72f30b7a..00600508 100644
--- a/resources/qml/Root.qml
+++ b/resources/qml/Root.qml
@@ -284,7 +284,7 @@ Pane {
destroyOnClose(dialog);
}
- function onShowImageOverlay(room, eventId, url, proportionalHeight, originalWidth) {
+ function onShowImageOverlay(room, eventId, url, originalWidth, proportionalHeight) {
var dialog = imageOverlay.createObject(timelineRoot, {
"room": room,
"eventId": eventId,
@@ -292,6 +292,7 @@ Pane {
"originalWidth": originalWidth ?? 0,
"proportionalHeight": proportionalHeight ?? 0
});
+
dialog.showFullScreen();
destroyOnClose(dialog);
}
diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml
index 23cca019..12e8a465 100644
--- a/resources/qml/delegates/ImageMessage.qml
+++ b/resources/qml/delegates/ImageMessage.qml
@@ -67,7 +67,7 @@ AbstractButton {
eventId: parent.eventId
}
- onClicked :Settings.openImageExternal ? room.openMedia(eventId) : TimelineManager.openImageOverlay(room, url, eventId);
+ onClicked :Settings.openImageExternal ? room.openMedia(eventId) : TimelineManager.openImageOverlay(room, url, eventId, originalWidth, proportionalHeight);
Item {
id: overlay
diff --git a/resources/qml/dialogs/ImageOverlay.qml b/resources/qml/dialogs/ImageOverlay.qml
index dff96f35..d245aca2 100644
--- a/resources/qml/dialogs/ImageOverlay.qml
+++ b/resources/qml/dialogs/ImageOverlay.qml
@@ -29,18 +29,17 @@ Window {
}
-
Item {
id: imgContainer
- property int imgSrcWidth: (originalWidth && originalWidth > 200) ? originalWidth : Screen.width
- property int imgSrcHeight: proportionalHeight ? imgSrcWidth * proportionalHeight : Screen.height
+ property int imgSrcWidth: (imageOverlay.originalWidth && imageOverlay.originalWidth > 100) ? imageOverlay.originalWidth : Screen.width
+ property int imgSrcHeight: imageOverlay.proportionalHeight ? imgSrcWidth * imageOverlay.proportionalHeight : Screen.height
- height: Math.min(parent.height, imgSrcHeight)
- width: Math.min(parent.width, imgSrcWidth)
+ height: Math.min(parent.height || Screen.height, imgSrcHeight)
+ width: Math.min(parent.width || Screen.width, imgSrcWidth)
- x: (parent.width - width)
- y: (parent.height - height)
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
Image {
id: img
diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml
index 60f1eb8d..d218e8fe 100644
--- a/resources/qml/dialogs/UserProfile.qml
+++ b/resources/qml/dialogs/UserProfile.qml
@@ -66,7 +66,7 @@ ApplicationWindow {
displayName: profile.displayName
userid: profile.userid
Layout.alignment: Qt.AlignHCenter
- onClicked: TimelineManager.openImageOverlay(null, profile.avatarUrl, "")
+ onClicked: TimelineManager.openImageOverlay(null, profile.avatarUrl, "", 0, 0)
ImageButton {
hoverEnabled: true
|