From e23acf46be90f1e9f3d552f3293b2220d9f58904 Mon Sep 17 00:00:00 2001 From: Fornax Date: Thu, 25 May 2023 20:31:29 +0200 Subject: [PATCH] Better icon dimensions --- svelte/src/filesystem/FilesystemUtil.js | 6 +++--- svelte/src/filesystem/SearchView.svelte | 2 +- svelte/src/filesystem/filemanager/GalleryView.svelte | 2 +- svelte/src/filesystem/filemanager/ListView.svelte | 2 +- svelte/src/filesystem/viewers/File.svelte | 2 +- svelte/src/filesystem/viewers/Torrent.svelte | 2 +- svelte/src/filesystem/viewers/Zip.svelte | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/svelte/src/filesystem/FilesystemUtil.js b/svelte/src/filesystem/FilesystemUtil.js index 45ad9ce..9f6d676 100644 --- a/svelte/src/filesystem/FilesystemUtil.js +++ b/svelte/src/filesystem/FilesystemUtil.js @@ -11,7 +11,7 @@ export const fs_file_url = (bucket, path) => { return fs_path_url(bucket, path) } -export const fs_thumbnail_url = (bucket, path, width = 128, height = 128) => { +export const fs_thumbnail_url = (bucket, path, width = 64, height = 64) => { return fs_path_url(bucket, path) + "?thumbnail&width=" + width + "&height=" + height } @@ -50,7 +50,7 @@ export const fs_node_type = node => { } } -export const fs_node_icon = (bucket, node) => { +export const fs_node_icon = (bucket, node, width = 64, height = 64) => { if (node.type === "dir") { // Folders with an ID are publically shared, use the shared folder icon if (node.id) { @@ -60,5 +60,5 @@ export const fs_node_icon = (bucket, node) => { } } - return fs_thumbnail_url(bucket, node.path) + return fs_thumbnail_url(bucket, node.path, width, height) } diff --git a/svelte/src/filesystem/SearchView.svelte b/svelte/src/filesystem/SearchView.svelte index cdf9284..e5589fb 100644 --- a/svelte/src/filesystem/SearchView.svelte +++ b/svelte/src/filesystem/SearchView.svelte @@ -103,7 +103,7 @@ const node_click = index => { class="node" > - icon + icon {result} diff --git a/svelte/src/filesystem/filemanager/GalleryView.svelte b/svelte/src/filesystem/filemanager/GalleryView.svelte index e6de5c1..74b19de 100644 --- a/svelte/src/filesystem/filemanager/GalleryView.svelte +++ b/svelte/src/filesystem/filemanager/GalleryView.svelte @@ -19,7 +19,7 @@ export let show_hidden = false
+ style='background-image: url("{fs_node_icon(state.root.id, child, 256, 256)}");'>
{child.name} diff --git a/svelte/src/filesystem/filemanager/ListView.svelte b/svelte/src/filesystem/filemanager/ListView.svelte index 3316aeb..4dffe35 100644 --- a/svelte/src/filesystem/filemanager/ListView.svelte +++ b/svelte/src/filesystem/filemanager/ListView.svelte @@ -25,7 +25,7 @@ export let show_hidden = false class:hidden={child.name.startsWith(".") && !show_hidden} > - icon + icon {child.name} diff --git a/svelte/src/filesystem/viewers/File.svelte b/svelte/src/filesystem/viewers/File.svelte index ab8751b..420c368 100644 --- a/svelte/src/filesystem/viewers/File.svelte +++ b/svelte/src/filesystem/viewers/File.svelte @@ -9,7 +9,7 @@ export let state

{state.base.name}

- + Type: {state.base.file_type}
No preview is available for this file type. Download to view it locally.
diff --git a/svelte/src/filesystem/viewers/Torrent.svelte b/svelte/src/filesystem/viewers/Torrent.svelte index acf99c6..f85a800 100644 --- a/svelte/src/filesystem/viewers/Torrent.svelte +++ b/svelte/src/filesystem/viewers/Torrent.svelte @@ -75,7 +75,7 @@ const copy_magnet = () => {

{state.base.name}

- + {#if status === "finished"} Created by: {torrent.created_by}
Comment: {torrent.comment}
diff --git a/svelte/src/filesystem/viewers/Zip.svelte b/svelte/src/filesystem/viewers/Zip.svelte index 909ab9f..a8369c2 100644 --- a/svelte/src/filesystem/viewers/Zip.svelte +++ b/svelte/src/filesystem/viewers/Zip.svelte @@ -61,7 +61,7 @@ const recursive_size = (file) => {

{state.base.name}

- + Compressed size: {formatDataVolume(state.base.file_size, 3)}
Uncompressed size: {formatDataVolume(uncomp_size, 3)} (Ratio: {comp_ratio.toFixed(2)}x)
Uploaded on: {formatDate(state.base.date_created, true, true, true)}