From e9c22d32bc3615360407caf544ed5751f30adb09 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Wed, 9 Aug 2023 01:08:49 +0200 Subject: [PATCH] feat: add an option to set the sidebar default state (#1462) --- src/App.vue | 79 +++++++----- src/components/TheSidebar.vue | 10 +- src/components/TheTopbar.vue | 53 +++++--- .../settings/SettingsUiSettingsTab.vue | 117 ++++++++++++------ src/locales/de.json | 5 + src/locales/en.json | 5 + src/store/gui/index.ts | 1 + src/store/gui/types.ts | 1 + src/store/mutations.ts | 1 + 9 files changed, 172 insertions(+), 100 deletions(-) diff --git a/src/App.vue b/src/App.vue index 24aacef7..29a4a2b7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,37 +1,11 @@ - - @@ -105,13 +79,27 @@ export default class App extends Mixins(BaseMixin) { return this.$store.getters['files/getMainBackground'] } + get naviDrawer(): boolean { + return this.$store.state.naviDrawer + } + + get navigationStyle() { + return this.$store.state.gui.uiSettings.navigationStyle + } + get mainStyle() { - let style = '' + let style: any = { + paddingLeft: '0', + } if (this.mainBackground !== null) { - style = 'background-image: url(' + this.mainBackground + ');' + style.backgroundImage = 'url(' + this.mainBackground + ')' } + // overwrite padding left for the sidebar + if (this.naviDrawer && this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px' + if (this.naviDrawer && this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px' + return style } @@ -311,3 +299,28 @@ export default class App extends Mixins(BaseMixin) { } } + + diff --git a/src/components/TheSidebar.vue b/src/components/TheSidebar.vue index 8050321b..6be678c9 100644 --- a/src/components/TheSidebar.vue +++ b/src/components/TheSidebar.vue @@ -1,7 +1,7 @@