diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-03-08 01:05:24 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-03-08 09:51:03 +0100 |
commit | c8d7a5acaabb5c2f8bae1ccb70ce9c76cfd86c5c (patch) | |
tree | c03f1e5331a6133b879775857c19c9bfd47ee5bd /lib | |
parent | b6691b35c7be946f038a6c8c6d221e64c60788f4 (diff) | |
download | nextcloud-server-c8d7a5acaabb5c2f8bae1ccb70ce9c76cfd86c5c.tar.gz nextcloud-server-c8d7a5acaabb5c2f8bae1ccb70ce9c76cfd86c5c.zip |
fix(AppManager): Allow to query dark **or** bright icon
The navigation needs the bright icon, while the notifications and activity need a dark icon.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppManager.php | 4 | ||||
-rw-r--r-- | lib/public/App/IAppManager.php | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 5dec4e7ccde..c6e6ba2975e 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -109,8 +109,8 @@ class AppManager implements IAppManager { ) { } - public function getAppIcon(string $appId): ?string { - $possibleIcons = [$appId . '.svg', 'app.svg', $appId . '-dark.svg', 'app-dark.svg']; + public function getAppIcon(string $appId, bool $dark = false): ?string { + $possibleIcons = $dark ? [$appId . '-dark.svg', 'app-dark.svg'] : [$appId . '.svg', 'app.svg']; $icon = null; foreach ($possibleIcons as $iconName) { try { diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 968771388dc..142e8bb8515 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -65,10 +65,11 @@ interface IAppManager { * Returns the app icon or null if none is found * * @param string $appId + * @param bool $dark Enable to request a dark icon variant, default is a white icon * @return string|null * @since 29.0.0 */ - public function getAppIcon(string $appId): string|null; + public function getAppIcon(string $appId, bool $dark = false): string|null; /** * Check if an app is enabled for user |