Sidebar compact issue1293 (#1462)

* #1293. Revise side-nav text labels

* #1293. Remove text on collapsed menu

* #1293. Height of collapsed Option

* Update side-nav.vue. Trending text in title attr

* Side-nav-more-options revised

* Restore navLabel on closed status

* Sidenav label in compact mode as an opt-in setting

* Sidenav-more-options using hideCompactSidebarText

* Sidenav after lintfix

* Sidenav label option renamed and moved to theme settings

* Set minimum height for .navOption

* Correct capitalization

* NavBar icon size on compact mode

* More compact navbar while hiding labels

* Fix store getter

* side-nav.css remove comments

* Update hide labels text

Co-authored-by: Preston <freetubeapp@protonmail.com>
This commit is contained in:
JInfantesC 2021-10-05 20:16:47 +00:00 committed by GitHub
parent e681772192
commit 9f591ba6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 215 additions and 77 deletions

View File

@ -50,9 +50,7 @@
.navOption, .closed .navOption { .navOption, .closed .navOption {
width: 70px; width: 70px;
height: 40px; height: 40px;
padding: 0px; padding: 10px 0px;
padding-top: 10px;
padding-bottom: 10px;
} }
.navLabel { .navLabel {
@ -67,10 +65,14 @@
margin-left: 0px; margin-left: 0px;
width: 100%; width: 100%;
display: block; display: block;
margin-bottom: 0px; margin-top: 0.5em;
} }
.moreOption { .moreOption {
display: block; display: block;
} }
.closed .navIconExpand{
height:1.3em;
}
} }

View File

@ -13,6 +13,14 @@ export default Vue.extend({
}, },
hideTrendingVideos: function () { hideTrendingVideos: function () {
return this.$store.getters.getHideTrendingVideos return this.$store.getters.getHideTrendingVideos
},
hideLabelsSideBar: function () {
return this.$store.getters.getHideLabelsSideBar
},
applyNavIconExpand: function() {
return {
navIconExpand: this.hideLabelsSideBar
}
} }
}, },
methods: { methods: {

View File

@ -2,13 +2,18 @@
<div class="sideNavMoreOptions"> <div class="sideNavMoreOptions">
<div <div
class="navOption moreOptionNav" class="navOption moreOptionNav"
:title="$t('More')"
@click="openMoreOptions = !openMoreOptions" @click="openMoreOptions = !openMoreOptions"
> >
<font-awesome-icon <font-awesome-icon
icon="ellipsis-h" icon="ellipsis-h"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p
v-if="!hideLabelsSideBar"
class="navLabel"
>
{{ $t("More") }} {{ $t("More") }}
</p> </p>
</div> </div>
@ -19,38 +24,54 @@
<div <div
v-if="!hideTrendingVideos" v-if="!hideTrendingVideos"
class="navOption" class="navOption"
:title="$t('Trending.Trending')"
@click="navigate('trending')" @click="navigate('trending')"
> >
<font-awesome-icon <font-awesome-icon
icon="fire" icon="fire"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p
v-if="!hideLabelsSideBar"
class="navLabel"
>
{{ $t("Trending.Trending") }} {{ $t("Trending.Trending") }}
</p> </p>
</div> </div>
<div <div
v-if="!hidePopularVideos" v-if="!hidePopularVideos"
class="navOption" class="navOption"
:title="$t('Most Popular')"
@click="navigate('popular')" @click="navigate('popular')"
> >
<font-awesome-icon <font-awesome-icon
icon="users" icon="users"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p
v-if="!hideLabelsSideBar"
class="navLabel"
>
{{ $t("Most Popular") }} {{ $t("Most Popular") }}
</p> </p>
</div> </div>
<div <div
class="navOption" class="navOption"
:title="$t('About.About')"
@click="navigate('about')" @click="navigate('about')"
> >
<font-awesome-icon <font-awesome-icon
icon="info-circle" icon="info-circle"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p
v-if="!hideLabelsSideBar"
class="navLabel"
>
{{ $t("About.About") }} {{ $t("About.About") }}
</p> </p>
</div> </div>
@ -62,6 +83,7 @@
<font-awesome-icon <font-awesome-icon
icon="history" icon="history"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p class="navLabel">
{{ $t("History.History") }} {{ $t("History.History") }}
@ -75,6 +97,7 @@
<font-awesome-icon <font-awesome-icon
icon="sliders-h" icon="sliders-h"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p class="navLabel">
{{ $t("Settings.Settings") }} {{ $t("Settings.Settings") }}
@ -87,8 +110,12 @@
<font-awesome-icon <font-awesome-icon
icon="info-circle" icon="info-circle"
class="navIcon" class="navIcon"
:class="applyNavIconExpand"
/> />
<p class="navLabel"> <p
v-if="!hideLabelsSideBar"
class="navLabel"
>
{{ $t("About.About") }} {{ $t("About.About") }}
</p> </p>
</div> </div>

View File

@ -26,6 +26,14 @@
width: 80px; width: 80px;
} }
.closed .hiddenLabels {
width: 60px;
}
.closed.hiddenLabels {
width: 60px;
}
.topNavOption { .topNavOption {
margin-top: 10px; margin-top: 10px;
} }
@ -34,6 +42,7 @@
position: relative; position: relative;
padding: 5px; padding: 5px;
cursor: pointer; cursor: pointer;
min-height: 35px;
} }
.moreOption { .moreOption {
@ -58,15 +67,18 @@
margin-left: 10px; margin-left: 10px;
} }
.navLabel { .navOption .navLabel {
margin-left: 5px; margin-left: 40px;
display: inline-block; overflow: hidden;
margin-left: 40px;
word-break: break-word;
} }
.navChannel .navLabel { .navChannel .navLabel {
font-size: 11px; overflow: hidden;
width: 150px;
margin-left: 40px; margin-left: 40px;
word-break: break-word;
font-size: 12px;
} }
.thumbnailContainer { .thumbnailContainer {
@ -106,10 +118,7 @@
.closed .navOption { .closed .navOption {
width: 100%; width: 100%;
height: 45px; padding: 5px 0px;
padding: 0px;
padding-top: 10px;
padding-bottom: 10px;
} }
.closed .navIcon { .closed .navIcon {
@ -118,6 +127,9 @@
display: block; display: block;
margin-bottom: 0px; margin-bottom: 0px;
} }
.closed .navIconExpand{
height:1.3em;
}
.closed .navLabel { .closed .navLabel {
margin-left: 0px; margin-left: 0px;
@ -125,24 +137,25 @@
text-align: center; text-align: center;
left: 0px; left: 0px;
font-size: 11px; font-size: 11px;
margin-block-end: 0em;
} }
.closed .navChannel { .closed .navChannel {
width: 100%; width: 100%;
padding: 0px; height: 45px;
padding-top: 10px; padding: 5px 0px;
padding-bottom: 10px;
} }
.closed .thumbnailContainer { .closed .thumbnailContainer {
position: static; position: static;
display: block; display: block;
float: none; float: none;
margin-left: 0px;
margin: 0 auto; margin: 0 auto;
top: 0px; top: 0px;
-ms-transform: none; -ms-transform: none;
transform: none; transform: none;
margin-block-start: 0.3em;
margin-block-end: 0.3em;
} }
@media only screen and (max-width: 680px) { @media only screen and (max-width: 680px) {
@ -189,14 +202,10 @@
font-size: 11px; font-size: 11px;
} }
.navIcon {
margin-left: 0px;
width: 100%;
display: block;
margin-bottom: 0px;
}
.moreOption { .moreOption {
display: block; display: block;
} }
.closed.hiddenLabels{
width: 100%;
}
} }

View File

@ -55,6 +55,22 @@ export default Vue.extend({
}, },
hideActiveSubscriptions: function () { hideActiveSubscriptions: function () {
return this.$store.getters.getHideActiveSubscriptions return this.$store.getters.getHideActiveSubscriptions
},
hideLabelsSideBar: function () {
return this.$store.getters.getHideLabelsSideBar
},
hideText: function () {
return !this.isOpen && this.hideLabelsSideBar
},
applyNavIconExpand: function() {
return {
navIconExpand: this.hideText
}
},
applyHiddenLabels: function() {
return {
hiddenLabels: this.hideText
}
} }
}, },
methods: { methods: {

View File

@ -2,21 +2,33 @@
<ft-flex-box <ft-flex-box
ref="sideNav" ref="sideNav"
class="sideNav" class="sideNav"
:class="{closed: !isOpen}" :class="[{closed: !isOpen}, applyHiddenLabels]"
> >
<div class="inner"> <div
class="inner"
:class="applyHiddenLabels"
>
<div <div
class="navOption topNavOption mobileShow" class="navOption topNavOption mobileShow "
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('Subscriptions.Subscriptions')"
@click="navigate('subscriptions')" @click="navigate('subscriptions')"
> >
<font-awesome-icon <div
icon="rss" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="rss"
<p class="navLabel"> class="navIcon"
:class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t("Subscriptions.Subscriptions") }} {{ $t("Subscriptions.Subscriptions") }}
</p> </p>
</div> </div>
@ -25,15 +37,24 @@
class="navOption mobileHidden" class="navOption mobileHidden"
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('Trending.Trending')"
@click="navigate('trending')" @click="navigate('trending')"
@keypress="navigate('trending')" @keypress="navigate('trending')"
> >
<font-awesome-icon <div
icon="fire" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="fire"
<p class="navLabel"> class="navIcon"
:class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t("Trending.Trending") }} {{ $t("Trending.Trending") }}
</p> </p>
</div> </div>
@ -42,15 +63,24 @@
class="navOption mobileHidden" class="navOption mobileHidden"
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('Most Popular')"
@click="navigate('popular')" @click="navigate('popular')"
@keypress="navigate('popular')" @keypress="navigate('popular')"
> >
<font-awesome-icon <div
icon="users" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="users"
<p class="navLabel"> class="navIcon"
:class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t("Most Popular") }} {{ $t("Most Popular") }}
</p> </p>
</div> </div>
@ -59,15 +89,24 @@
class="navOption mobileShow" class="navOption mobileShow"
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('Playlists')"
@click="navigate('userplaylists')" @click="navigate('userplaylists')"
@keypress="navigate('userplaylists')" @keypress="navigate('userplaylists')"
> >
<font-awesome-icon <div
icon="bookmark" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="bookmark"
<p class="navLabel"> class="navIcon"
:class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t("Playlists") }} {{ $t("Playlists") }}
</p> </p>
</div> </div>
@ -78,15 +117,24 @@
class="navOption mobileShow" class="navOption mobileShow"
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('History.History')"
@click="navigate('history')" @click="navigate('history')"
@keypress="navigate('history')" @keypress="navigate('history')"
> >
<font-awesome-icon <div
icon="history" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="history"
<p class="navLabel"> class="navIcon"
:class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t("History.History") }} {{ $t("History.History") }}
</p> </p>
</div> </div>
@ -95,31 +143,49 @@
class="navOption mobileShow" class="navOption mobileShow"
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('Settings.Settings')"
@click="navigate('settings')" @click="navigate('settings')"
@keypress="navigate('settings')" @keypress="navigate('settings')"
> >
<font-awesome-icon <div
icon="sliders-h" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="sliders-h"
<p class="navLabel"> class="navIcon"
{{ $t("Settings.Settings") }} :class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t('Settings.Settings') }}
</p> </p>
</div> </div>
<div <div
class="navOption mobileHidden" class="navOption mobileHidden"
role="button" role="button"
tabindex="0" tabindex="0"
:title="$t('About.About')"
@click="navigate('about')" @click="navigate('about')"
@keypress="navigate('about')" @keypress="navigate('about')"
> >
<font-awesome-icon <div
icon="info-circle" class="thumbnailContainer"
class="navIcon" >
fixed-width <font-awesome-icon
/> icon="info-circle"
<p class="navLabel"> class="navIcon"
:class="applyNavIconExpand"
fixed-width
/>
</div>
<p
v-if="!hideText"
class="navLabel"
>
{{ $t("About.About") }} {{ $t("About.About") }}
</p> </p>
</div> </div>

View File

@ -81,7 +81,9 @@ export default Vue.extend({
disableSmoothScrolling: function () { disableSmoothScrolling: function () {
return this.$store.getters.getDisableSmoothScrolling return this.$store.getters.getDisableSmoothScrolling
}, },
hideLabelsSideBar: function () {
return this.$store.getters.getHideLabelsSideBar
},
restartPromptMessage: function () { restartPromptMessage: function () {
return this.$t('Settings["The app needs to restart for changes to take effect. Restart and apply change?"]') return this.$t('Settings["The app needs to restart for changes to take effect. Restart and apply change?"]')
}, },
@ -215,7 +217,8 @@ export default Vue.extend({
...mapActions([ ...mapActions([
'updateBarColor', 'updateBarColor',
'updateUiScale', 'updateUiScale',
'updateDisableSmoothScrolling' 'updateDisableSmoothScrolling',
'updateHideLabelsSideBar'
]) ])
} }
}) })

View File

@ -22,6 +22,11 @@
:default-value="disableSmoothScrollingToggleValue" :default-value="disableSmoothScrollingToggleValue"
@change="handleRestartPrompt" @change="handleRestartPrompt"
/> />
<ft-toggle-switch
:label="$t('Settings.Theme Settings.Hide Side Bar Labels')"
:default-value="hideLabelsSideBar"
@change="updateHideLabelsSideBar"
/>
</ft-flex-box> </ft-flex-box>
<ft-flex-box> <ft-flex-box>
<ft-slider <ft-slider

View File

@ -196,6 +196,7 @@ const state = {
hideVideoLikesAndDislikes: false, hideVideoLikesAndDislikes: false,
hideVideoViews: false, hideVideoViews: false,
hideWatchedSubs: false, hideWatchedSubs: false,
hideLabelsSideBar: false,
landingPage: 'subscriptions', landingPage: 'subscriptions',
listType: 'grid', listType: 'grid',
playNextVideo: false, playNextVideo: false,

View File

@ -158,6 +158,7 @@ Settings:
Expand Side Bar by Default: Expand Side Bar by Default Expand Side Bar by Default: Expand Side Bar by Default
Disable Smooth Scrolling: Disable Smooth Scrolling Disable Smooth Scrolling: Disable Smooth Scrolling
UI Scale: UI Scale UI Scale: UI Scale
Hide Side Bar Labels: Hide Side Bar Labels
Base Theme: Base Theme:
Base Theme: Base Theme Base Theme: Base Theme
Black: Black Black: Black