Changeset View
Changeset View
Standalone View
Standalone View
src/contents/ui/event-types/Image.qml
Show All 32 Lines | Simple { | ||||
property var imageMxcUri: fileHandler.encryptedFileMxcUri || fileHandler.unencryptedFileMxcUri | property var imageMxcUri: fileHandler.encryptedFileMxcUri || fileHandler.unencryptedFileMxcUri | ||||
property var innerContentWidth: upper.contentMaxWidth - bubble.bubbleSpacing | property var innerContentWidth: upper.contentMaxWidth - bubble.bubbleSpacing | ||||
property var jobManager: kazvIOManager | property var jobManager: kazvIOManager | ||||
property var mtxSdk: matrixSdk | property var mtxSdk: matrixSdk | ||||
property var isSticker: event.type === 'm.sticker' | property var isSticker: event.type === 'm.sticker' | ||||
summaryItem: Label { | |||||
objectName: 'summaryLabel' | |||||
Layout.alignment: Qt.AlignLeft | |||||
Layout.fillWidth: true | |||||
elide: Text.ElideRight | |||||
text: l10n.get(isSticker ? 'event-summary-sticker-sent' : 'event-summary-image-sent', { gender, body}) | |||||
} | |||||
Kazv.FileHandler { | Kazv.FileHandler { | ||||
id: fileHandler | id: fileHandler | ||||
eventContent: event.content | eventContent: event.content | ||||
autoCache: true | autoCache: true | ||||
kazvIOManager: upper.jobManager | kazvIOManager: upper.jobManager | ||||
matrixSdk: upper.mtxSdk | matrixSdk: upper.mtxSdk | ||||
} | } | ||||
Types.MediaBubble { | Types.MediaBubble { | ||||
id: bubble | id: bubble | ||||
eventContent: event.content | eventContent: event.content | ||||
property var label: Kazv.SelectableText { | property var label: Kazv.SelectableText { | ||||
objectName: 'bodyLabel' | |||||
Layout.fillWidth: true | Layout.fillWidth: true | ||||
wrapMode: Text.Wrap | wrapMode: Text.Wrap | ||||
text: isSticker ? '' : l10n.get('event-message-image-sent', { gender, body }) | text: l10n.get(isSticker ? 'event-message-sticker-sent' : 'event-message-image-sent', { gender, body}) | ||||
visible: !compactMode | |||||
} | } | ||||
property var image: Image { | property var image: Image { | ||||
id: image | id: image | ||||
Layout.fillWidth: true | Layout.fillWidth: true | ||||
Layout.preferredWidth: calcImageWidth() | Layout.preferredWidth: calcImageWidth() | ||||
Layout.preferredHeight: width < calcImageWidth() ? calcImageHeight() / calcImageWidth() * width : calcImageHeight() | Layout.preferredHeight: width < calcImageWidth() ? calcImageHeight() / calcImageWidth() * width : calcImageHeight() | ||||
source: fileHandler.kazvIOJob ? "" : fileHandler.cachedFile | source: fileHandler.kazvIOJob ? "" : fileHandler.cachedFile | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |