diff --git a/apps/theming/lib/Listener/BeforePreferenceListener.php b/apps/theming/lib/Listener/BeforePreferenceListener.php index 47b7d3fb6ffa0..b89931084be9a 100644 --- a/apps/theming/lib/Listener/BeforePreferenceListener.php +++ b/apps/theming/lib/Listener/BeforePreferenceListener.php @@ -34,6 +34,12 @@ /** @template-implements IEventListener */ class BeforePreferenceListener implements IEventListener { + + /** + * @var string[] + */ + private const ALLOWED_KEYS = ['force_enable_blur_filter', 'shortcuts_disabled', 'primary_color']; + public function __construct( private IAppManager $appManager, ) { diff --git a/apps/theming/lib/Settings/Personal.php b/apps/theming/lib/Settings/Personal.php index f24aaa2f8f83f..eb61e1262713e 100644 --- a/apps/theming/lib/Settings/Personal.php +++ b/apps/theming/lib/Settings/Personal.php @@ -74,6 +74,7 @@ public function getForm(): TemplateResponse { $this->initialStateService->provideInitialState('themes', array_values($themes)); $this->initialStateService->provideInitialState('enforceTheme', $enforcedTheme); $this->initialStateService->provideInitialState('isUserThemingDisabled', $this->themingDefaults->isUserThemingDisabled()); + $this->initialStateService->provideInitialState('enableBlurFilter', $this->config->getUserValue($this->userId, 'theming', 'force_enable_blur_filter', '')); $this->initialStateService->provideInitialState('navigationBar', [ 'userAppOrder' => json_decode($this->config->getUserValue($this->userId, 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR), 'enforcedDefaultApp' => $forcedDefaultApp diff --git a/apps/theming/src/UserThemes.vue b/apps/theming/src/UserThemes.vue index d941bf9c1db2f..75d88962243c7 100644 --- a/apps/theming/src/UserThemes.vue +++ b/apps/theming/src/UserThemes.vue @@ -51,6 +51,14 @@ type="font" @change="changeFont" /> + +

{{ t('theming', 'Misc accessibility options') }}

+ + {{ t('theming', 'Enable blur background filter (may increase GPU load)') }} + theme.enabled === true).map(theme => theme.id) const enabledFontsIDs = this.fonts.filter(font => font.enabled === true).map(font => font.id) diff --git a/apps/theming/tests/Settings/PersonalTest.php b/apps/theming/tests/Settings/PersonalTest.php index 0a9bf4b59c93f..f44a88ad56628 100644 --- a/apps/theming/tests/Settings/PersonalTest.php +++ b/apps/theming/tests/Settings/PersonalTest.php @@ -47,14 +47,15 @@ use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class PersonalTest extends TestCase { - private IConfig $config; - private ThemesService $themesService; - private IInitialState $initialStateService; - private ThemingDefaults $themingDefaults; - private IAppManager $appManager; + private IConfig&MockObject $config; + private ThemesService&MockObject $themesService; + private IInitialState&MockObject $initialStateService; + private ThemingDefaults&MockObject $themingDefaults; + private IAppManager&MockObject $appManager; private Personal $admin; /** @var ITheme[] */ @@ -132,7 +133,7 @@ public function testGetForm(string $enforcedTheme, $themesState) { ['enforceTheme', $enforcedTheme], ['isUserThemingDisabled', false], ['navigationBar', ['userAppOrder' => [], 'enforcedDefaultApp' => 'forcedapp']], - ); + ]); $expected = new TemplateResponse('theming', 'settings-personal'); $this->assertEquals($expected, $this->admin->getForm()); @@ -174,6 +175,7 @@ private function initThemes() { $config, $l10n, $appManager, + null, ), 'light' => new LightTheme( $util, @@ -184,6 +186,7 @@ private function initThemes() { $config, $l10n, $appManager, + null, ), 'dark' => new DarkTheme( $util, @@ -194,6 +197,7 @@ private function initThemes() { $config, $l10n, $appManager, + null, ), 'light-highcontrast' => new HighContrastTheme( $util, @@ -204,6 +208,7 @@ private function initThemes() { $config, $l10n, $appManager, + null, ), 'dark-highcontrast' => new DarkHighContrastTheme( $util, @@ -214,6 +219,7 @@ private function initThemes() { $config, $l10n, $appManager, + null, ), 'opendyslexic' => new DyslexiaFont( $util, @@ -224,6 +230,7 @@ private function initThemes() { $config, $l10n, $appManager, + null, ), ]; }