From fa924f087d1ac633975b3b4f25cfdf38b45247be Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Mon, 23 Jan 2023 20:47:43 +0100 Subject: [PATCH] Custom views! --- frontend/src/components/grid-items.svelte | 16 +- frontend/src/components/tabbar.svelte | 64 +++++- .../collection/find-viewconfig.svelte | 171 ++++++++++------ .../connection/collection/find.svelte | 57 ++---- frontend/src/stores.js | 18 +- frontend/src/style.css | 7 + frontend/src/utils.js | 15 ++ frontend/wailsjs/go/app/App.d.ts | 6 + frontend/wailsjs/go/app/App.js | 12 ++ internal/app/collection_find_views.go | 182 ++++++++++++++++++ internal/app/hosts.go | 15 +- 11 files changed, 437 insertions(+), 126 deletions(-) create mode 100644 internal/app/collection_find_views.go diff --git a/frontend/src/components/grid-items.svelte b/frontend/src/components/grid-items.svelte index c3d7624..e93b0a6 100644 --- a/frontend/src/components/grid-items.svelte +++ b/frontend/src/components/grid-items.svelte @@ -40,14 +40,16 @@ } function select(itemKey) { - activeKey = itemKey; - if (level === 0) { - activePath = [ itemKey ]; + if (activeKey !== itemKey) { + activeKey = itemKey; + if (level === 0) { + activePath = [ itemKey ]; + } + else { + activePath = [ ...path, itemKey ]; + } + dispatch('select', { level, itemKey }); } - else { - activePath = [ ...path, itemKey ]; - } - dispatch('select', { level, itemKey }); } function closeAll() { diff --git a/frontend/src/components/tabbar.svelte b/frontend/src/components/tabbar.svelte index 475ccbd..c9668e1 100644 --- a/frontend/src/components/tabbar.svelte +++ b/frontend/src/components/tabbar.svelte @@ -1,8 +1,10 @@ removeView(e.detail)} + bind:selectedKey={activeViewKey} />
- {#if activeTab === 'list'} -
- -