Page MenuHomePhorge

No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/src/contents/ui/event-types/Image.qml b/src/contents/ui/event-types/Image.qml
index f12cd34..4148126 100644
--- a/src/contents/ui/event-types/Image.qml
+++ b/src/contents/ui/event-types/Image.qml
@@ -1,67 +1,71 @@
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2021 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import org.kde.kirigami 2.13 as Kirigami
import '..' as Kazv
Simple {
id: upper
property var gender: 'neutral'
property var body: event.content.body
property var mxcUri: event.content.url
property var imageUri: matrixSdk.mxcUriToHttp(mxcUri)
property var imageInfo: event.content.info || {}
property var imageWidth: image.implicitWidth || imageInfo.w || 1 // lest we divide by 0
property var imageHeight: image.implicitHeight || imageInfo.h || 1
property var innerContentWidth: upper.contentMaxWidth - bubble.bubbleSpacing
Kazv.Bubble {
id: bubble
ColumnLayout {
id: layout
Label {
Layout.fillWidth: false
Layout.maximumWidth: innerContentWidth
wrapMode: Text.Wrap
text: l10n.get('event-message-image-sent', { gender, body })
}
Image {
id: image
source: imageUri
Layout.maximumWidth: innerContentWidth
Layout.preferredWidth: imageWidth
Layout.preferredHeight: imageHeight / imageWidth * width
fillMode: Image.PreserveAspectFit
- MouseArea {
- anchors.fill: parent
+ TapHandler {
acceptedButtons: Qt.LeftButton | Qt.RightButton
-
- onClicked: {
- if (mouse.button === Qt.RightButton) {
+ onSingleTapped: {
+ if (eventPoint.event.button === Qt.RightButton) {
optionMenu.popup()
}
+ if (eventPoint.event.button === Qt.LeftButton) {
+ // TODO: Open in other program
+ }
+ }
+ onLongPressed: {
+ optionMenu.popup()
}
}
Menu {
id: optionMenu
MenuItem {
text: l10n.get('menu-option-save-as')
}
}
}
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Jan 19, 2:04 PM (21 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55218
Default Alt Text
(2 KB)

Event Timeline