Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open/close all settings tabs persistent toggle #4204

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ export default defineComponent({
type: String,
required: true
}
},
computed: {
allSettingsSectionsExpandedByDefault: function () {
return this.$store.getters.getAllSettingsSectionsExpandedByDefault
}
}
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<details class="settingsSection">
<details
:open="allSettingsSectionsExpandedByDefault ? 'true' : null"
class="settingsSection"
>
<summary class="sectionHeader">
<h3 class="sectionTitle">
{{ title }}
Expand Down
1 change: 1 addition & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const defaultSideEffectsTriggerId = settingId =>
/*****/

const state = {
allSettingsSectionsExpandedByDefault: false,
autoplayPlaylists: true,
autoplayVideos: true,
backendFallback: process.env.IS_ELECTRON,
Expand Down
10 changes: 10 additions & 0 deletions src/renderer/views/Settings/Settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ hr {
border: 0;
background-color: var(--scrollbar-color-hover);
}

.switchColumnGrid {
inline-size: 85%;
margin-inline: auto;
}

.settingsToggle {
padding-block: 0;
margin-block: 10px 5px;
}
14 changes: 13 additions & 1 deletion src/renderer/views/Settings/Settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import GeneralSettings from '../../components/general-settings/general-settings.vue'
import ThemeSettings from '../../components/theme-settings/theme-settings.vue'
import PlayerSettings from '../../components/player-settings/player-settings.vue'
Expand All @@ -14,6 +15,7 @@ import ParentControlSettings from '../../components/parental-control-settings/pa
import ExperimentalSettings from '../../components/experimental-settings/experimental-settings.vue'
import PasswordSettings from '../../components/password-settings/password-settings.vue'
import PasswordDialog from '../../components/password-dialog/password-dialog.vue'
import FtToggleSwitch from '../../components/ft-toggle-switch/ft-toggle-switch.vue'

export default defineComponent({
name: 'Settings',
Expand All @@ -33,6 +35,7 @@ export default defineComponent({
'experimental-settings': ExperimentalSettings,
'password-settings': PasswordSettings,
'password-dialog': PasswordDialog,
'ft-toggle-switch': FtToggleSwitch
},
data: function () {
return {
Expand All @@ -46,11 +49,20 @@ export default defineComponent({

settingsPassword: function () {
return this.$store.getters.getSettingsPassword
}
},

allSettingsSectionsExpandedByDefault: function () {
return this.$store.getters.getAllSettingsSectionsExpandedByDefault
},
},
created: function () {
if (this.settingsPassword === '') {
this.unlocked = true
}
},
methods: {
...mapActions([
'updateAllSettingsSectionsExpandedByDefault',
])
}
})
11 changes: 11 additions & 0 deletions src/renderer/views/Settings/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<template>
<div>
<template v-if="unlocked">
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
class="settingsToggle"
:label="$t('Settings.Expand All Settings Sections')"
:default-value="allSettingsSectionsExpandedByDefault"
:compact="false"
@change="updateAllSettingsSectionsExpandedByDefault"
/>
</div>
</div>
<general-settings />
<hr>
<theme-settings />
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ History:
Settings:
# On Settings Page
Settings: Settings
Expand All Settings Sections: Expand All Settings Sections
The app needs to restart for changes to take effect. Restart and apply change?: The
app needs to restart for changes to take effect. Restart and apply change?
General Settings:
Expand Down