nicer clipboard

Massimo Melina committed Apr 11, 2024 at 00:13 UTC e774480dfb35df12286dc409420b108f6398842c
4 files changed +26 -12
frontend/src/clip.ts
+7 -5
@@ -18,11 +18,13 @@ export function ClipBar() {
18 return null
19 const there = dirname(clip[0].uri) + '/'
20 return h('div', { id: 'clipBar' },
21 - h(Btn, { label: t`Cancel clipboard`, icon: 'close', onClick: cancel }),
22 - h(Btn, { label: t('to_clipboard_source', "Back to source folder"), icon: 'parent', onClick: goBack, disabled: here === there }),
21 + h(Btn, { label: t('clipboard', { content: t('n_items', { n: clip.length }, "{n,plural, one{# item} other{# items}}"), }, `Clipboard ({content})`),
22 + onClick: show, style: { flex: 1 } }),
23 h(Btn, { label: t`Paste`, icon: 'paste', onClick: paste, disabled: here === there || !props?.can_upload }),
24 - h('div', { onClick: show, style: { flex: 1 } },
25 - clip.length === 1 ? clip[0].name : t('n_items', { n: clip.length }, "{n,plural, one{# item} other{# items}}") ),
24 + h(Btn, { label: t`Cancel clipboard`, icon: 'close', onClick: cancel }),
25 + h(Btn, { label: t('to_clipboard_source', "Back to source folder"), icon: 'parent', onClick: goBack, disabled: here === there,
26 + tooltip: t('to_clipboard_source_tooltip', "Go to the folder where the clipboard contents are located"),
27 + }),
28 )
29
30 function cancel() {
@@ -34,7 +36,7 @@ export function ClipBar() {
36 }
37
38 function show() {
37 - alertDialog(h('div', {},
39 + alertDialog(h('div', { id: 'clipboard-content' },
40 t('clipboard_list', "Items in clipboard:"),
41 clip.map(x => h('li', {}, x.name)),
42 ))
frontend/src/index.scss
+7 -2
@@ -124,7 +124,7 @@ button {
124 padding: .5em;
125 &:not(.before-sliding) { min-width: min-content; }
126 &.small { padding: 0 0.4em; height: 30px; }
127 - .icon { position: relative; top: .05em; }
127 + .icon { position: relative; top: .05em; margin: -.2em 0; }
128 border: transparent;
129 text-decoration: none;
130 border-radius: 0.3em;
@@ -541,6 +541,11 @@ button .icon + .label {
541 box-shadow: 0 0 .3em .3em var(--bg);
542
543 display: flex; align-items: center; gap: 0.5em;
544 + margin: 0 1px;
545 +}
546 +#clipboard-content {
547 + text-align: left;
548 + li:first-of-type { margin-top: .5em }
549 }
550
551 .tiles-mode {
@@ -781,7 +786,7 @@ button .icon + .label {
786 :root { --ghost-contrast: #8883; } /* phones have different curve */
787 body, button, select { font-size: 14pt; }
788 #menu-bar, #filter-bar, #clipBar {
784 - button .label { display: none } /* icons only */
789 + button .icon + .label { display: none } /* icons only */
790 }
791 #filter-bar {
792 margin-top: 0.4em;
src/langs/hfs-lang-en.json
+5 -2
@@ -1,7 +1,7 @@
1 {
2 "author": "NAME OF THE AUTHOR(S) OF THIS TRANSLATION",
3 "version": 1.0,
4 - "hfs_version": "0.52.0",
4 + "hfs_version": "0.53.0",
5 "translate": {
6 "Select": "Select",
7 "n_files": "{n,plural,one{# file} other{# files}}",
@@ -163,6 +163,9 @@
163 "Overwrite policy": "Overwrite policy",
164 "Rename to avoid overwriting": "Rename to avoid overwriting",
165 "Overwrite existing files": "Overwrite existing files",
166 - "Menu": "Menu"
166 + "Menu": "Menu",
167 +
168 + "clipboard": "Clipboard ({content})",
169 + "to_clipboard_source_tooltip": "Go to the folder where the clipboard contents are located"
170 }
171 }
src/langs/hfs-lang-it.json
+7 -3
@@ -1,7 +1,7 @@
1 {
2 "author": "Massimo Melina",
3 - "version": 1.9,
4 - "hfs_version": "0.52.0",
3 + "version": 2.53,
4 + "hfs_version": "0.53.0",
5 "translate": {
6 "Select": "Seleziona",
7 "n_files": "{n} file",
@@ -154,6 +154,10 @@
154 "upload_skipped": "{n,plural, one{# saltato} other{# saltati}}",
155 "Overwrite policy": "Per i file esistenti",
156 "Rename to avoid overwriting": "Rinomina per non sovrascrivere",
157 - "Overwrite existing files": "Sovrascrivi i file esistenti"
157 + "Overwrite existing files": "Sovrascrivi i file esistenti",
158 + "Menu": "Menu",
159 +
160 + "clipboard": "Appunti ({content})",
161 + "to_clipboard_source_tooltip": "Vai alla cartella d'origine dei file negli appunti"
162 }
163 }