diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php index 653b895be2c9ffaeb8d698e1cea6272fd9ba88d9..49cd72d4255a95a4f82b88cb3fcb7ff0781fbaf3 100644 --- a/apps/theming/lib/Service/ThemesService.php +++ b/apps/theming/lib/Service/ThemesService.php @@ -28,7 +28,7 @@ class ThemesService { private LoggerInterface $logger, private DefaultTheme $defaultTheme, LightTheme $lightTheme, - DarkTheme $darkTheme, + private DarkTheme $darkTheme, HighContrastTheme $highContrastTheme, DarkHighContrastTheme $darkHighContrastTheme, DyslexiaFont $dyslexiaFont) { @@ -59,9 +59,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 b1f52f2134c64be3ee02a197cb45eef242876981..c5e78607912f29b16f7841928e15b16673a670ee 100644 --- a/apps/theming/src/components/ItemPreview.vue +++ b/apps/theming/src/components/ItemPreview.vue @@ -13,7 +13,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" @@ -73,6 +76,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 @@ -89,6 +96,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 6339a837fa6e563079a62ec8959de355b4b287a3..03a5667833a99455542e36361cfbd96e9e1bd120 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 aadb31c2c2a34b958547f87734bf72391a5caa3a..481307c3dd2d5ef9bc4c62b45a92a3296e3cd938 100644 Binary files a/dist/theming-personal-theming.js.map and b/dist/theming-personal-theming.js.map differ