summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-04-23 20:55:28 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-04-23 20:55:28 +0200
commit6a03615413ef90e378df80fa1e3bc4ef031d5ea6 (patch)
treec577c21e1c3cda9f7c50a9545c7a57720de762b9 /resources/qml
parentTranslated using Weblate (Ukrainian) (diff)
downloadnheko-6a03615413ef90e378df80fa1e3bc4ef031d5ea6.tar.xz
Copy image to clipboard
Fixes #599
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/dialogs/ImageOverlay.qml36
1 files changed, 36 insertions, 0 deletions
diff --git a/resources/qml/dialogs/ImageOverlay.qml b/resources/qml/dialogs/ImageOverlay.qml
index 6f56e79a..fa874529 100644
--- a/resources/qml/dialogs/ImageOverlay.qml
+++ b/resources/qml/dialogs/ImageOverlay.qml
@@ -29,6 +29,17 @@ Window {
         onActivated: imageOverlay.close()
     }
 
+    Shortcut {
+        sequence: StandardKey.Copy
+        onActivated: {
+            if (room) {
+                room.copyMedia(eventId);
+            } else {
+                TimelineManager.copyImage(url);
+            }
+        }
+    }
+
     TapHandler {
         onSingleTapped: imageOverlay.close();
     }
@@ -111,10 +122,33 @@ Window {
             height: 48
             width: 48
             hoverEnabled: true
+            image: ":/icons/icons/ui/copy.svg"
+
+            //ToolTip.visible: hovered
+            //ToolTip.delay: Nheko.tooltipDelay
+            //ToolTip.text: qsTr("Copy to clipboard")
+
+            onClicked: {
+                imageOverlay.hide();
+                if (room) {
+                    room.copyMedia(eventId);
+                } else {
+                    TimelineManager.copyImage(url);
+                }
+                imageOverlay.close();
+            }
+        }
+
+        ImageButton {
+            height: 48
+            width: 48
+            hoverEnabled: true
             image: ":/icons/icons/ui/download.svg"
+
             //ToolTip.visible: hovered
             //ToolTip.delay: Nheko.tooltipDelay
             //ToolTip.text: qsTr("Download")
+
             onClicked: {
                 imageOverlay.hide();
                 if (room) {
@@ -130,9 +164,11 @@ Window {
             width: 48
             hoverEnabled: true
             image: ":/icons/icons/ui/dismiss.svg"
+
             //ToolTip.visible: hovered
             //ToolTip.delay: Nheko.tooltipDelay
             //ToolTip.text: qsTr("Close")
+            
             onClicked: imageOverlay.close()
         }
     }