Skip to content

Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.

fix(desktop): the Shelf sends copied images, says what it's sending, and counts down with reduce motion

Bee521737fe7993
diff --git a/desktop/app/i18n/nectarlink_de.ts b/desktop/app/i18n/nectarlink_de.ts
index 4a93fd8..5f6d47b 100644
--- a/desktop/app/i18n/nectarlink_de.ts
+++ b/desktop/app/i18n/nectarlink_de.ts
@@ -8060,174 +8060,189 @@ Voraussetzungen
<translation>NectarLink Shelf</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="50"/>
+ <location filename="../qml/ShelfWindow.qml" line="53"/>
<source>phone</source>
<translation>Gerät</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="141"/>
+ <location filename="../qml/ShelfWindow.qml" line="158"/>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="143"/>
+ <location filename="../qml/ShelfWindow.qml" line="160"/>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="145"/>
+ <location filename="../qml/ShelfWindow.qml" line="162"/>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="146"/>
+ <location filename="../qml/ShelfWindow.qml" line="163"/>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="292"/>
+ <location filename="../qml/ShelfWindow.qml" line="309"/>
<source>Shelf</source>
<translation>Shelf</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="301"/>
+ <location filename="../qml/ShelfWindow.qml" line="318"/>
<source>No phone connected</source>
<translation>Kein Gerät verbunden</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="313"/>
+ <location filename="../qml/ShelfWindow.qml" line="330"/>
<source>Refresh Shelf</source>
<translation>Shelf aktualisieren</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="319"/>
+ <location filename="../qml/ShelfWindow.qml" line="336"/>
<source>Close Shelf</source>
<translation>Shelf schließen</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="373"/>
+ <location filename="../qml/ShelfWindow.qml" line="390"/>
<source>Release to send to %1</source>
<translation>Loslassen, um an %1 zu senden</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="376"/>
+ <location filename="../qml/ShelfWindow.qml" line="393"/>
<source>Sent to %1</source>
<translation>An %1 gesendet</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="377"/>
+ <location filename="../qml/ShelfWindow.qml" line="394"/>
<source>Queued for %1</source>
<translation>Für %1 in der Warteschlange</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="379"/>
+ <location filename="../qml/ShelfWindow.qml" line="396"/>
<source>Send cancelled</source>
<translation>Senden abgebrochen</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="380"/>
+ <location filename="../qml/ShelfWindow.qml" line="397"/>
<source>Drop or flick items here to send</source>
<translation>Elemente zum Senden hier ablegen oder nach oben wischen</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="414"/>
+ <location filename="../qml/ShelfWindow.qml" line="432"/>
+ <source>Sending %1 to %2…</source>
+ <translation>Sende %1 an %2…</translation>
+ </message>
+ <message>
+ <location filename="../qml/ShelfWindow.qml" line="433"/>
<source>Sending to %1…</source>
<translation>Wird an %1 gesendet…</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="424"/>
+ <location filename="../qml/ShelfWindow.qml" line="443"/>
<source>Undo</source>
<translation>Rückgängig</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="464"/>
+ <location filename="../qml/ShelfWindow.qml" line="483"/>
<source>Latest photo</source>
<translation>Neuestes Foto</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="465"/>
+ <location filename="../qml/ShelfWindow.qml" line="484"/>
<source>No recent photo</source>
<translation>Kein aktuelles Foto</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="471"/>
+ <location filename="../qml/ShelfWindow.qml" line="490"/>
<source>Latest screenshot</source>
<translation>Neuester Screenshot</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="472"/>
+ <location filename="../qml/ShelfWindow.qml" line="491"/>
<source>No recent screenshot</source>
<translation>Kein aktueller Screenshot</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="713"/>
+ <location filename="../qml/ShelfWindow.qml" line="732"/>
<source>Copy</source>
<translation>Kopieren</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="725"/>
+ <location filename="../qml/ShelfWindow.qml" line="744"/>
<source>Open</source>
<translation>Öffnen</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="821"/>
+ <location filename="../qml/ShelfWindow.qml" line="840"/>
<source>Current clip</source>
<translation>Aktuelle Zwischenablage</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="836"/>
+ <location filename="../qml/ShelfWindow.qml" line="857"/>
<source>Send clip to phone</source>
<translation>Zwischenablage an Gerät senden</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="839"/>
- <location filename="../qml/ShelfWindow.qml" line="955"/>
+ <location filename="../qml/ShelfWindow.qml" line="861"/>
+ <location filename="../qml/ShelfWindow.qml" line="980"/>
+ <source>the copied image</source>
+ <translation>das kopierte Bild</translation>
+ </message>
+ <message>
+ <location filename="../qml/ShelfWindow.qml" line="863"/>
+ <location filename="../qml/ShelfWindow.qml" line="983"/>
+ <source>the copied text</source>
+ <translation>den kopierten Text</translation>
+ </message>
+ <message>
<source>Clip</source>
- <translation>Zwischenablage</translation>
+ <translation type="vanished">Zwischenablage</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="847"/>
+ <location filename="../qml/ShelfWindow.qml" line="871"/>
<source>Copy clip</source>
<translation>Inhalt kopieren</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="881"/>
- <location filename="../qml/ShelfWindow.qml" line="902"/>
+ <location filename="../qml/ShelfWindow.qml" line="905"/>
+ <location filename="../qml/ShelfWindow.qml" line="926"/>
<source>Clipboard is empty</source>
<translation>Zwischenablage ist leer</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="901"/>
+ <location filename="../qml/ShelfWindow.qml" line="925"/>
<source>Current clip: %1</source>
<translation>Aktuelle Zwischenablage: %1</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1014"/>
+ <location filename="../qml/ShelfWindow.qml" line="1042"/>
<source>Recent received files</source>
<translation>Zuletzt empfangene Dateien</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1029"/>
+ <location filename="../qml/ShelfWindow.qml" line="1057"/>
<source>No received files yet</source>
<translation>Noch keine empfangenen Dateien</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1213"/>
+ <location filename="../qml/ShelfWindow.qml" line="1241"/>
<source>Send to phone</source>
<translation>An Gerät senden</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1224"/>
+ <location filename="../qml/ShelfWindow.qml" line="1252"/>
<source>Open file</source>
<translation>Datei öffnen</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1232"/>
+ <location filename="../qml/ShelfWindow.qml" line="1260"/>
<source>Show in folder</source>
<translation>Im Ordner anzeigen</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1247"/>
+ <location filename="../qml/ShelfWindow.qml" line="1275"/>
<source>Flick any card up to send to phone, drag out to use, or drop files in</source>
<translation>Wische eine Karte nach oben, um sie ans Gerät zu senden, ziehe sie heraus oder lege Dateien hier ab</translation>
</message>
diff --git a/desktop/app/i18n/nectarlink_zh_CN.ts b/desktop/app/i18n/nectarlink_zh_CN.ts
index 2d02fd6..9879964 100644
--- a/desktop/app/i18n/nectarlink_zh_CN.ts
+++ b/desktop/app/i18n/nectarlink_zh_CN.ts
@@ -8056,174 +8056,189 @@ What it needs
<translation>NectarLink 收纳架</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="50"/>
+ <location filename="../qml/ShelfWindow.qml" line="53"/>
<source>phone</source>
<translation>手机</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="141"/>
+ <location filename="../qml/ShelfWindow.qml" line="158"/>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="143"/>
+ <location filename="../qml/ShelfWindow.qml" line="160"/>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="145"/>
+ <location filename="../qml/ShelfWindow.qml" line="162"/>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="146"/>
+ <location filename="../qml/ShelfWindow.qml" line="163"/>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="292"/>
+ <location filename="../qml/ShelfWindow.qml" line="309"/>
<source>Shelf</source>
<translation>收纳架</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="301"/>
+ <location filename="../qml/ShelfWindow.qml" line="318"/>
<source>No phone connected</source>
<translation>未连接手机</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="313"/>
+ <location filename="../qml/ShelfWindow.qml" line="330"/>
<source>Refresh Shelf</source>
<translation>刷新收纳架</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="319"/>
+ <location filename="../qml/ShelfWindow.qml" line="336"/>
<source>Close Shelf</source>
<translation>关闭收纳架</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="373"/>
+ <location filename="../qml/ShelfWindow.qml" line="390"/>
<source>Release to send to %1</source>
<translation>松开以发送到 %1</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="376"/>
+ <location filename="../qml/ShelfWindow.qml" line="393"/>
<source>Sent to %1</source>
<translation>已发送到 %1</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="377"/>
+ <location filename="../qml/ShelfWindow.qml" line="394"/>
<source>Queued for %1</source>
<translation>已加入 %1 的发送队列</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="379"/>
+ <location filename="../qml/ShelfWindow.qml" line="396"/>
<source>Send cancelled</source>
<translation>已取消发送</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="380"/>
+ <location filename="../qml/ShelfWindow.qml" line="397"/>
<source>Drop or flick items here to send</source>
<translation>将项目拖放到此处或向上轻扫即可发送</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="414"/>
+ <location filename="../qml/ShelfWindow.qml" line="432"/>
+ <source>Sending %1 to %2…</source>
+ <translation>正在将%1发送到 %2…</translation>
+ </message>
+ <message>
+ <location filename="../qml/ShelfWindow.qml" line="433"/>
<source>Sending to %1…</source>
<translation>正在发送到 %1…</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="424"/>
+ <location filename="../qml/ShelfWindow.qml" line="443"/>
<source>Undo</source>
<translation>撤销</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="464"/>
+ <location filename="../qml/ShelfWindow.qml" line="483"/>
<source>Latest photo</source>
<translation>最新照片</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="465"/>
+ <location filename="../qml/ShelfWindow.qml" line="484"/>
<source>No recent photo</source>
<translation>暂无近期照片</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="471"/>
+ <location filename="../qml/ShelfWindow.qml" line="490"/>
<source>Latest screenshot</source>
<translation>最新截图</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="472"/>
+ <location filename="../qml/ShelfWindow.qml" line="491"/>
<source>No recent screenshot</source>
<translation>暂无近期截图</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="713"/>
+ <location filename="../qml/ShelfWindow.qml" line="732"/>
<source>Copy</source>
<translation>复制</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="725"/>
+ <location filename="../qml/ShelfWindow.qml" line="744"/>
<source>Open</source>
<translation>打开</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="821"/>
+ <location filename="../qml/ShelfWindow.qml" line="840"/>
<source>Current clip</source>
<translation>当前剪贴内容</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="836"/>
+ <location filename="../qml/ShelfWindow.qml" line="857"/>
<source>Send clip to phone</source>
<translation>发送剪贴内容到手机</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="839"/>
- <location filename="../qml/ShelfWindow.qml" line="955"/>
+ <location filename="../qml/ShelfWindow.qml" line="861"/>
+ <location filename="../qml/ShelfWindow.qml" line="980"/>
+ <source>the copied image</source>
+ <translation>复制的图片</translation>
+ </message>
+ <message>
+ <location filename="../qml/ShelfWindow.qml" line="863"/>
+ <location filename="../qml/ShelfWindow.qml" line="983"/>
+ <source>the copied text</source>
+ <translation>复制的文本</translation>
+ </message>
+ <message>
<source>Clip</source>
- <translation>剪贴内容</translation>
+ <translation type="vanished">剪贴内容</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="847"/>
+ <location filename="../qml/ShelfWindow.qml" line="871"/>
<source>Copy clip</source>
<translation>复制剪贴内容</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="881"/>
- <location filename="../qml/ShelfWindow.qml" line="902"/>
+ <location filename="../qml/ShelfWindow.qml" line="905"/>
+ <location filename="../qml/ShelfWindow.qml" line="926"/>
<source>Clipboard is empty</source>
<translation>剪贴板为空</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="901"/>
+ <location filename="../qml/ShelfWindow.qml" line="925"/>
<source>Current clip: %1</source>
<translation>当前剪贴内容:%1</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1014"/>
+ <location filename="../qml/ShelfWindow.qml" line="1042"/>
<source>Recent received files</source>
<translation>最近接收的文件</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1029"/>
+ <location filename="../qml/ShelfWindow.qml" line="1057"/>
<source>No received files yet</source>
<translation>暂无接收的文件</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1213"/>
+ <location filename="../qml/ShelfWindow.qml" line="1241"/>
<source>Send to phone</source>
<translation>发送到手机</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1224"/>
+ <location filename="../qml/ShelfWindow.qml" line="1252"/>
<source>Open file</source>
<translation>打开文件</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1232"/>
+ <location filename="../qml/ShelfWindow.qml" line="1260"/>
<source>Show in folder</source>
<translation>在文件夹中显示</translation>
</message>
<message>
- <location filename="../qml/ShelfWindow.qml" line="1247"/>
+ <location filename="../qml/ShelfWindow.qml" line="1275"/>
<source>Flick any card up to send to phone, drag out to use, or drop files in</source>
<translation>向上轻扫任意卡片即可发送到手机,拖出即可使用,也可将文件拖入</translation>
</message>
diff --git a/desktop/app/i18n/template/nectarlink.ts b/desktop/app/i18n/template/nectarlink.ts
index 2b0c2dc..a8f7bbc 100644
--- a/desktop/app/i18n/template/nectarlink.ts
+++ b/desktop/app/i18n/template/nectarlink.ts
@@ -7791,174 +7791,185 @@ What it needs
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="50"/>
+ <location filename="../../qml/ShelfWindow.qml" line="53"/>
<source>phone</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="141"/>
+ <location filename="../../qml/ShelfWindow.qml" line="158"/>
<source>%1 B</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="143"/>
+ <location filename="../../qml/ShelfWindow.qml" line="160"/>
<source>%1 KB</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="145"/>
+ <location filename="../../qml/ShelfWindow.qml" line="162"/>
<source>%1 MB</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="146"/>
+ <location filename="../../qml/ShelfWindow.qml" line="163"/>
<source>%1 GB</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="292"/>
+ <location filename="../../qml/ShelfWindow.qml" line="309"/>
<source>Shelf</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="301"/>
+ <location filename="../../qml/ShelfWindow.qml" line="318"/>
<source>No phone connected</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="313"/>
+ <location filename="../../qml/ShelfWindow.qml" line="330"/>
<source>Refresh Shelf</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="319"/>
+ <location filename="../../qml/ShelfWindow.qml" line="336"/>
<source>Close Shelf</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="373"/>
+ <location filename="../../qml/ShelfWindow.qml" line="390"/>
<source>Release to send to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="376"/>
+ <location filename="../../qml/ShelfWindow.qml" line="393"/>
<source>Sent to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="377"/>
+ <location filename="../../qml/ShelfWindow.qml" line="394"/>
<source>Queued for %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="379"/>
+ <location filename="../../qml/ShelfWindow.qml" line="396"/>
<source>Send cancelled</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="380"/>
+ <location filename="../../qml/ShelfWindow.qml" line="397"/>
<source>Drop or flick items here to send</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="414"/>
+ <location filename="../../qml/ShelfWindow.qml" line="432"/>
+ <source>Sending %1 to %2…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../../qml/ShelfWindow.qml" line="433"/>
<source>Sending to %1…</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="424"/>
+ <location filename="../../qml/ShelfWindow.qml" line="443"/>
<source>Undo</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="464"/>
+ <location filename="../../qml/ShelfWindow.qml" line="483"/>
<source>Latest photo</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="465"/>
+ <location filename="../../qml/ShelfWindow.qml" line="484"/>
<source>No recent photo</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="471"/>
+ <location filename="../../qml/ShelfWindow.qml" line="490"/>
<source>Latest screenshot</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="472"/>
+ <location filename="../../qml/ShelfWindow.qml" line="491"/>
<source>No recent screenshot</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="713"/>
+ <location filename="../../qml/ShelfWindow.qml" line="732"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="725"/>
+ <location filename="../../qml/ShelfWindow.qml" line="744"/>
<source>Open</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="821"/>
+ <location filename="../../qml/ShelfWindow.qml" line="840"/>
<source>Current clip</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="836"/>
+ <location filename="../../qml/ShelfWindow.qml" line="857"/>
<source>Send clip to phone</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="839"/>
- <location filename="../../qml/ShelfWindow.qml" line="955"/>
- <source>Clip</source>
+ <location filename="../../qml/ShelfWindow.qml" line="861"/>
+ <location filename="../../qml/ShelfWindow.qml" line="980"/>
+ <source>the copied image</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../../qml/ShelfWindow.qml" line="863"/>
+ <location filename="../../qml/ShelfWindow.qml" line="983"/>
+ <source>the copied text</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="847"/>
+ <location filename="../../qml/ShelfWindow.qml" line="871"/>
<source>Copy clip</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="881"/>
- <location filename="../../qml/ShelfWindow.qml" line="902"/>
+ <location filename="../../qml/ShelfWindow.qml" line="905"/>
+ <location filename="../../qml/ShelfWindow.qml" line="926"/>
<source>Clipboard is empty</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="901"/>
+ <location filename="../../qml/ShelfWindow.qml" line="925"/>
<source>Current clip: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="1014"/>
+ <location filename="../../qml/ShelfWindow.qml" line="1042"/>
<source>Recent received files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="1029"/>
+ <location filename="../../qml/ShelfWindow.qml" line="1057"/>
<source>No received files yet</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="1213"/>
+ <location filename="../../qml/ShelfWindow.qml" line="1241"/>
<source>Send to phone</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="1224"/>
+ <location filename="../../qml/ShelfWindow.qml" line="1252"/>
<source>Open file</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="1232"/>
+ <location filename="../../qml/ShelfWindow.qml" line="1260"/>
<source>Show in folder</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../../qml/ShelfWindow.qml" line="1247"/>
+ <location filename="../../qml/ShelfWindow.qml" line="1275"/>
<source>Flick any card up to send to phone, drag out to use, or drop files in</source>
<translation type="unfinished"></translation>
</message>
diff --git a/desktop/app/qml/ShelfWindow.qml b/desktop/app/qml/ShelfWindow.qml
index 5fb3b93..0ea44c1 100644
--- a/desktop/app/qml/ShelfWindow.qml
+++ b/desktop/app/qml/ShelfWindow.qml
@@ -43,16 +43,20 @@ Window {
property var pendingUrls: []
property string pendingText: ""
property string pendingLabel: ""
+ /// An image clip waiting out the undo; it's sent from clipboard history.
+ property string pendingClipId: ""
property real undoProgress: 0.0
+ property double undoStartedAt: 0
readonly property string targetPhoneName: shelfData.hasDevice && shelfData.deviceName.length > 0
? shelfData.deviceName
: qsTr("phone")
- function queueSendToPhone(urls, text, label) {
+ function queueSendToPhone(urls, text, label, clipId) {
const cleanUrls = urls ? urls : []
const cleanText = text ? String(text) : ""
- if (cleanUrls.length === 0 && cleanText.trim().length === 0)
+ const cleanClip = clipId ? String(clipId) : ""
+ if (cleanUrls.length === 0 && cleanText.trim().length === 0 && cleanClip.length === 0)
return
if (!shelfData.hasDevice) {
// Nothing to send to: the app says no phone is paired yet.
@@ -65,11 +69,15 @@ Window {
pendingUrls = cleanUrls
pendingText = cleanText
pendingLabel = label ? String(label) : ""
+ pendingClipId = cleanClip
undoCancelled = false
justDropped = false
undoPending = true
undoProgress = 1.0
- if (!Theme.reduceMotion) {
+ undoStartedAt = Date.now()
+ if (Theme.reduceMotion) {
+ undoStepTimer.restart()
+ } else {
undoProgressAnim.restart()
}
undoSendTimer.restart()
@@ -80,14 +88,21 @@ Window {
return
undoSendTimer.stop()
undoProgressAnim.stop()
+ undoStepTimer.stop()
const urls = pendingUrls
const text = pendingText
+ const clipId = pendingClipId
undoPending = false
pendingUrls = []
pendingText = ""
pendingLabel = ""
+ pendingClipId = ""
undoProgress = 0.0
- if (urls.length > 0 || text.trim().length > 0) {
+ if (clipId.length > 0) {
+ AppController.sendClipboardHistory(shelfData.deviceId, clipId)
+ justDropped = true
+ dropConfirmTimer.restart()
+ } else if (urls.length > 0 || text.trim().length > 0) {
AppController.dropToShelf(urls, text)
justDropped = true
dropConfirmTimer.restart()
@@ -99,10 +114,12 @@ Window {
return
undoSendTimer.stop()
undoProgressAnim.stop()
+ undoStepTimer.stop()
undoPending = false
pendingUrls = []
pendingText = ""
pendingLabel = ""
+ pendingClipId = ""
undoProgress = 0.0
justDropped = false
undoCancelled = true
@@ -161,16 +178,9 @@ Window {
}
}
- Shortcut {
- sequence: "Escape"
- onActivated: AppController.closeShelf()
- }
-
- Shortcut {
- sequence: "Ctrl+Z"
- enabled: shelfWin.undoPending
- onActivated: shelfWin.cancelPendingSend()
- }
+ // No keyboard shortcuts: the window never takes focus
+ // (WindowDoesNotAcceptFocus), so window shortcuts could never fire, and
+ // app-wide ones would take Ctrl+Z from the app you're working in.
Timer {
id: undoSendTimer
@@ -189,6 +199,13 @@ Window {
easing.type: Easing.Linear
}
+ Timer {
+ id: undoStepTimer
+ interval: 250
+ repeat: true
+ onTriggered: shelfWin.undoProgress = Math.max(0, 1 - (Date.now() - shelfWin.undoStartedAt) / undoSendTimer.interval)
+ }
+
Timer {
id: dropConfirmTimer
interval: 1800
@@ -411,7 +428,9 @@ Window {
weight: 600
elide: Text.ElideRight
color: Theme.primaryContainerContent
- text: qsTr("Sending to %1…").arg(shelfWin.targetPhoneName)
+ text: shelfWin.pendingLabel.length > 0
+ ? qsTr("Sending %1 to %2…").arg(shelfWin.pendingLabel).arg(shelfWin.targetPhoneName)
+ : qsTr("Sending to %1…").arg(shelfWin.targetPhoneName)
}
}
@@ -831,12 +850,17 @@ Window {
IconButton {
width: 24
height: 24
- visible: clipCard.hasClip && (clipCard.clipData.text || "").length > 0
+ visible: clipCard.hasClip
+ && ((clipCard.clipData.text || "").length > 0
+ || (clipCard.clipData.kind === "image" && clipCard.clipId.length > 0))
iconPath: Icons.send
label: qsTr("Send clip to phone")
onClicked: {
clipFlickAnim.restart()
- shelfWin.queueSendToPhone([], clipCard.clipData.text || "", qsTr("Clip"))
+ if (clipCard.clipData.kind === "image")
+ shelfWin.queueSendToPhone([], "", qsTr("the copied image"), clipCard.clipId)
+ else
+ shelfWin.queueSendToPhone([], clipCard.clipData.text || "", qsTr("the copied text"))
}
}
@@ -950,9 +974,13 @@ Window {
flicking = false
dragged = true
clipCard.flickOffsetX = 0
- if (shouldSend && (clipCard.clipData.text || "").length > 0) {
+ const isImage = clipCard.clipData.kind === "image"
+ if (shouldSend && isImage && clipCard.clipId.length > 0) {
+ clipFlickAnim.restart()
+ shelfWin.queueSendToPhone([], "", qsTr("the copied image"), clipCard.clipId)
+ } else if (shouldSend && (clipCard.clipData.text || "").length > 0) {
clipFlickAnim.restart()
- shelfWin.queueSendToPhone([], clipCard.clipData.text || "", qsTr("Clip"))
+ shelfWin.queueSendToPhone([], clipCard.clipData.text || "", qsTr("the copied text"))
} else {
clipCard.flickOffsetY = 0
}