Implemented slim Sidebar setting

Still need to move back the toast messages when slimSidebar is set
This commit is contained in:
RemixDev 2020-10-29 13:08:42 +01:00
parent 4e652b65cc
commit cf71f295f2
5 changed files with 31 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@
class="top-0 left-0 flex flex-col w-64 h-screen bg-panels-bg text-foreground" class="top-0 left-0 flex flex-col w-64 h-screen bg-panels-bg text-foreground"
role="navigation" role="navigation"
aria-label="sidebar" aria-label="sidebar"
ref="sidebar"
> >
<router-link <router-link
tag="a" tag="a"
@ -217,6 +218,11 @@ export default {
socket.on('updateAvailable', () => { socket.on('updateAvailable', () => {
this.updateAvailable = true this.updateAvailable = true
}) })
// Check if download tab has slim entries
if ('true' === localStorage.getItem('slimSidebar')) {
this.$refs.sidebar.classList.add('slim')
}
}, },
methods: { methods: {
changeTheme(newTheme) { changeTheme(newTheme) {

View File

@ -72,6 +72,10 @@
<input type="checkbox" v-model="changeSlimDownloads" /> <input type="checkbox" v-model="changeSlimDownloads" />
<span class="checkbox_text">{{ $t('settings.appearance.slimDownloadTab') }}</span> <span class="checkbox_text">{{ $t('settings.appearance.slimDownloadTab') }}</span>
</label> </label>
<label class="with_checkbox">
<input type="checkbox" v-model="changeSlimSidebar" />
<span class="checkbox_text">{{ $t('settings.appearance.slimSidebar') }}</span>
</label>
</div> </div>
<div class="settings-group"> <div class="settings-group">
@ -683,6 +687,7 @@ export default {
lastUser: '', lastUser: '',
spotifyUser: '', spotifyUser: '',
slimDownloads: false, slimDownloads: false,
slimSidebar: false,
previewVolume: window.vol, previewVolume: window.vol,
accountNum: 0, accountNum: 0,
accounts: [] accounts: []
@ -708,6 +713,16 @@ export default {
localStorage.setItem('slimDownloads', wantSlimDownloads) localStorage.setItem('slimDownloads', wantSlimDownloads)
} }
}, },
changeSlimSidebar: {
get() {
return this.slimSidebar
},
set(wantSlimSidebar) {
this.slimSidebar = wantSlimSidebar
document.getElementById('sidebar').classList.toggle('slim', wantSlimSidebar)
localStorage.setItem('slimSidebar', wantSlimSidebar)
}
},
pictureHref() { pictureHref() {
// Default image: https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg // Default image: https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg
return `https://e-cdns-images.dzcdn.net/images/user/${this.user.picture}/125x125-000000-80-0-0.jpg` return `https://e-cdns-images.dzcdn.net/images/user/${this.user.picture}/125x125-000000-80-0-0.jpg`
@ -734,6 +749,7 @@ export default {
} }
this.changeSlimDownloads = 'true' === localStorage.getItem('slimDownloads') this.changeSlimDownloads = 'true' === localStorage.getItem('slimDownloads')
this.changeSlimSidebar = 'true' === localStorage.getItem('slimSidebar')
let volume = parseInt(localStorage.getItem('previewVolume')) let volume = parseInt(localStorage.getItem('previewVolume'))

View File

@ -199,7 +199,8 @@ const en = {
}, },
appearance: { appearance: {
title: 'Appearance', title: 'Appearance',
slimDownloadTab: 'Slim download tab' slimDownloadTab: 'Slim download tab',
slimSidebar: 'Slim Sidebar'
}, },
downloadPath: { downloadPath: {
title: 'Download Path' title: 'Download Path'

View File

@ -203,7 +203,8 @@ const it = {
}, },
appearance: { appearance: {
title: 'Aspetto', title: 'Aspetto',
slimDownloadTab: 'Tab dei download slim' slimDownloadTab: 'Tab dei download slim',
slimSidebar: 'Sidebar slim'
}, },
downloadPath: { downloadPath: {
title: 'Cartella di download' title: 'Cartella di download'