From ea95c726012968226470534e34f32a9bc77e0463 Mon Sep 17 00:00:00 2001 From: herteleo Date: Sun, 28 Apr 2019 20:23:29 +0200 Subject: [PATCH] feat(settings): hideable tab labels in navigation --- src/components/AppLayout.vue | 37 ++++++++++++++++++++++++++++++++-- src/components/TabsNav.vue | 9 +++++++++ src/components/TabsNavItem.vue | 13 +++++++++--- src/store/modules/Settings.js | 1 + src/views/Settings.vue | 21 +++++++++++++++++++ 5 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/components/AppLayout.vue b/src/components/AppLayout.vue index b15bdad..8686046 100644 --- a/src/components/AppLayout.vue +++ b/src/components/AppLayout.vue @@ -4,8 +4,10 @@ [$style.app]: true, [$style.app__osMac]: $options.isMac, [$style.app__osWin]: $options.isWin, - [$style.app__layoutLeft_extended]: !isLayoutInverted, - [$style.app__layoutRight_extended]: isLayoutInverted, + [$style.app__layoutLeft_compact]: !isLayoutInverted && !displaysTabLabels, + [$style.app__layoutLeft_extended]: !isLayoutInverted && displaysTabLabels, + [$style.app__layoutRight_compact]: isLayoutInverted && !displaysTabLabels, + [$style.app__layoutRight_extended]: isLayoutInverted && displaysTabLabels, }" >
@@ -65,6 +70,13 @@ export default { height: 100vh; } +.app__osMac.app__layoutLeft_compact { + grid-template-areas: + "space space title title title" + "aside main main main main" + ; +} + .app__osMac.app__layoutLeft_extended { grid-template-areas: "space space title title title" @@ -72,6 +84,13 @@ export default { ; } +.app__osMac.app__layoutRight_compact { + grid-template-areas: + "space space title title ....." + "main main main main aside" + ; +} + .app__osMac.app__layoutRight_extended { grid-template-areas: "space space title ..... ....." @@ -79,6 +98,13 @@ export default { ; } +.app__osWin.app__layoutLeft_compact { + grid-template-areas: + "title title title space space" + "aside main main main main" + ; +} + .app__osWin.app__layoutLeft_extended { grid-template-areas: "title title title space space" @@ -86,6 +112,13 @@ export default { ; } +.app__osWin.app__layoutRight_compact { + grid-template-areas: + "title title title space space" + "main main main main aside" + ; +} + .app__osWin.app__layoutRight_extended { grid-template-areas: "title title title space space" diff --git a/src/components/TabsNav.vue b/src/components/TabsNav.vue index 92f2cdf..a3d4667 100644 --- a/src/components/TabsNav.vue +++ b/src/components/TabsNav.vue @@ -11,11 +11,13 @@ v-for="tab in tabList" :key="tab.id" :item="tab" + :show-label="displaysTabLabels" />
@@ -70,6 +75,10 @@ export default { @apply mt-auto; } +.footer__extended { + @apply flex flex-row-reverse; +} + .drag { @apply cursor-move text-blue-lighter bg-blue; } diff --git a/src/components/TabsNavItem.vue b/src/components/TabsNavItem.vue index 41a38a5..8460fb5 100644 --- a/src/components/TabsNavItem.vue +++ b/src/components/TabsNavItem.vue @@ -26,7 +26,10 @@ face="tab" />
-
+
{{ item.label }}
@@ -39,6 +42,10 @@ export default { type: Object, default: () => ({}), }, + showLabel: { + type: Boolean, + required: true, + }, }, computed: { pageState() { @@ -71,7 +78,7 @@ export default { .thumb { @apply flex flex-no-shrink justify-center items-center - p-1 w-8 h-8 mr-3 rounded-sm; + p-1 w-8 h-8 rounded-sm; } .thumbIsImage { @@ -87,6 +94,6 @@ export default { } .label { - @apply truncate; + @apply ml-3 truncate; } diff --git a/src/store/modules/Settings.js b/src/store/modules/Settings.js index 8d75593..1aa2542 100644 --- a/src/store/modules/Settings.js +++ b/src/store/modules/Settings.js @@ -6,6 +6,7 @@ const db = new Connection({ 'dimmer.dimDelayInMs': 5000, 'dimmer.dimIfWindowIsNotInFocus': false, 'layout.sideBarLocation': 'left', + 'navigation.displayTabLabels': true, 'notifications.holdBackIfWindowIsNotInFocus': false, 'notifications.sendSummaryIfWindowIsNotInFocus': false, 'notifications.summaryIntervalInMs': 1200000, diff --git a/src/views/Settings.vue b/src/views/Settings.vue index ca1f15a..7887497 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -44,6 +44,19 @@
+ +