diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php index 0fb6cee6824935487745f5e6bffaa6bba2edbb74..d080752a032a3b1a37348885f0c570da0332d4e0 100644 --- a/apps/theming/lib/Service/ThemesService.php +++ b/apps/theming/lib/Service/ThemesService.php @@ -45,7 +45,7 @@ class ThemesService { private LoggerInterface $logger, private DefaultTheme $defaultTheme, LightTheme $lightTheme, - DarkTheme $darkTheme, + private DarkTheme $darkTheme, HighContrastTheme $highContrastTheme, DarkHighContrastTheme $darkHighContrastTheme, DyslexiaFont $dyslexiaFont) { @@ -76,9 +76,15 @@ class ThemesService { } $defaultTheme = $this->themesProviders[$this->defaultTheme->getId()]; + $darkTheme = $this->themesProviders[$this->darkTheme->getId()]; $theme = $this->themesProviders[$enforcedTheme]; return [ + // Leave the default theme as a fallback $defaultTheme->getId() => $defaultTheme, + // Make sure we also have the dark theme to allow apps + // to scope sections of their UI to the dark theme + $darkTheme->getId() => $darkTheme, + // Finally, the enforced theme $theme->getId() => $theme, ]; } diff --git a/apps/theming/src/components/ItemPreview.vue b/apps/theming/src/components/ItemPreview.vue index 5f817d04f499ce016e9f52d34a3d68259399b55a..64b88afb22419a086d1b3ed643b8a67432f180ae 100644 --- a/apps/theming/src/components/ItemPreview.vue +++ b/apps/theming/src/components/ItemPreview.vue @@ -7,7 +7,10 @@ <span v-if="enforced" class="theming__preview-warning" role="note"> {{ t('theming', 'Theme selection is enforced') }} </span> - <NcCheckboxRadioSwitch class="theming__preview-toggle" + + <!-- Only show checkbox if we can change themes --> + <NcCheckboxRadioSwitch v-show="!enforced" + class="theming__preview-toggle" :checked.sync="checked" :disabled="enforced" :name="name" @@ -67,6 +70,10 @@ export default { return this.selected }, set(checked) { + if (this.enforced) { + return + } + console.debug('Changed theme', this.theme.id, checked) // If this is a radio, we can only enable @@ -83,6 +90,10 @@ export default { methods: { onToggle() { + if (this.enforced) { + return + } + if (this.switchType === 'radio') { this.checked = true return diff --git a/dist/theming-personal-theming.js b/dist/theming-personal-theming.js index 1769ce443940e816dac6b219505e4bb3317db6ad..51ca688fadc36d3790cf503ddd9bc9026607d9d3 100644 Binary files a/dist/theming-personal-theming.js and b/dist/theming-personal-theming.js differ diff --git a/dist/theming-personal-theming.js.map b/dist/theming-personal-theming.js.map index 04d6b687771afd633504c7ef211c199ed6bc7cee..34605c65198e27ec0de4ecf2708db4817f6deab4 100644 Binary files a/dist/theming-personal-theming.js.map and b/dist/theming-personal-theming.js.map differ