summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-05-10 03:19:53 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-05-10 03:20:09 +0200
commita6b2be112b9a9450998985cbc5ec4ce10a5ae432 (patch)
treeac8f472f4a662679f3304c380e95f75d12b2415e /resources
parentAdd mtxclient to logging (diff)
downloadnheko-a6b2be112b9a9450998985cbc5ec4ce10a5ae432.tar.xz
More image dialog fixes
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/Root.qml3
-rw-r--r--resources/qml/delegates/ImageMessage.qml2
-rw-r--r--resources/qml/dialogs/ImageOverlay.qml13
-rw-r--r--resources/qml/dialogs/UserProfile.qml2
4 files changed, 10 insertions, 10 deletions
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