Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F113862
D99.1732489323.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D99.1732489323.diff
View Options
diff --git a/src/contents/ui/Bubble.qml b/src/contents/ui/Bubble.qml
--- a/src/contents/ui/Bubble.qml
+++ b/src/contents/ui/Bubble.qml
@@ -22,6 +22,7 @@
property var menuContent: []
readonly property var bubbleSpacing: leftPadding + rightPadding
+ readonly property double replyMaxHeight: Kirigami.Units.gridUnit * 7
Layout.fillWidth: true
Layout.preferredHeight: bubbleRootLayout.implicitHeight
@@ -122,7 +123,7 @@
Layout.fillWidth: true
Layout.margins: 0
Layout.preferredHeight: inReplyToLayout.implicitHeight
- Layout.maximumHeight: Kirigami.Units.gridUnit * 5
+ Layout.maximumHeight: upper.replyMaxHeight
clip: true
onClicked: eventListView.goToEvent(bubbleRootLayout.replyToOrAnnotatedEventId)
diff --git a/src/contents/ui/event-types/Image.qml b/src/contents/ui/event-types/Image.qml
--- a/src/contents/ui/event-types/Image.qml
+++ b/src/contents/ui/event-types/Image.qml
@@ -30,6 +30,7 @@
property var imageFile: event.content.file || {}
property var imageWidth: imageInfo.w
property var imageHeight: imageInfo.h
+ property var imageMaxHeight: compactMode ? Kirigami.Units.gridUnit * 5 : Infinity
property var imageMxcUri: fileHandler.encryptedFileMxcUri || fileHandler.unencryptedFileMxcUri
property var innerContentWidth: upper.contentMaxWidth - bubble.bubbleSpacing
@@ -70,9 +71,12 @@
property var image: Image {
id: image
+ objectName: 'mainImage'
Layout.fillWidth: true
- Layout.preferredWidth: calcImageWidth()
- Layout.preferredHeight: width < calcImageWidth() ? calcImageHeight() / calcImageWidth() * width : calcImageHeight()
+ property var privHeight: Math.min(imageMaxHeight, calcImageHeight())
+ property var privWidth: privHeight / calcImageHeight() * calcImageWidth()
+ Layout.preferredWidth: privWidth
+ Layout.preferredHeight: width < privWidth ? privHeight / privHeight * width : privHeight
source: fileHandler.kazvIOJob ? "" : fileHandler.cachedFile
horizontalAlignment: Image.AlignLeft
fillMode: Image.PreserveAspectFit
diff --git a/src/tests/quick-tests/tst_EventView.qml b/src/tests/quick-tests/tst_EventView.qml
--- a/src/tests/quick-tests/tst_EventView.qml
+++ b/src/tests/quick-tests/tst_EventView.qml
@@ -9,7 +9,7 @@
import QtTest 1.0
import moe.kazv.mxc.kazv 0.0 as MK
-
+import org.kde.kirigami 2.13 as Kirigami
import '../../contents/ui' as Kazv
import 'test-helpers.js' as Helpers
import 'test-helpers' as TestHelpers
@@ -140,6 +140,10 @@
content: {
msgtype: 'm.image',
body: 'some body',
+ info: {
+ h: Kirigami.Units.gridUnit * 10,
+ w: Kirigami.Units.gridUnit * 10,
+ }
},
formattedTime: '4:06 P.M.',
})
@@ -589,6 +593,9 @@
verify(findChild(eventViewSticker, 'bodyLabel').visible);
verify(findChild(eventViewStickerCompact, 'summaryLabel').visible);
verify(!findChild(eventViewStickerCompact, 'bodyLabel').visible);
+
+ const image = findChild(eventViewImageCompact, 'mainImage');
+ verify(image.height <= Kirigami.Units.gridUnit * 5);
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 3:02 PM (10 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39932
Default Alt Text
D99.1732489323.diff (3 KB)
Attached To
Mode
D99: Downscale image in compact mode
Attached
Detach File
Event Timeline
Log In to Comment