Skip to content

Commit 86b502a

Browse files
committed
fix(core): keep app menu settings icon legible on light backgrounds
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 73cd2bf commit 86b502a

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

core/src/components/AppMenu.vue

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,17 @@
5454
:aria-expanded="opened ? 'true' : 'false'"
5555
@click="onTriggerClick('currentApp')">
5656
<template #icon>
57+
<!-- Settings sub-sections share one generic cog. An inline MDI icon
58+
inherits the button's currentColor (--color-background-plain-text),
59+
so it stays legible on both bright and dark headers without a filter. -->
60+
<IconCog
61+
v-if="currentApp.type === 'settings'"
62+
class="app-menu__current-app-cog"
63+
:size="20" />
5764
<img
65+
v-else
5866
class="app-menu__current-app-icon"
59-
:class="{ 'app-menu__current-app-icon--settings': currentApp.type === 'settings' }"
60-
:src="displayIcon"
67+
:src="currentApp.icon"
6168
alt=""
6269
aria-hidden="true">
6370
</template>
@@ -79,6 +86,7 @@ import { generateUrl, imagePath } from '@nextcloud/router'
7986
import { defineComponent, ref } from 'vue'
8087
import NcButton from '@nextcloud/vue/components/NcButton'
8188
import NcPopover from '@nextcloud/vue/components/NcPopover'
89+
import IconCog from 'vue-material-design-icons/Cog.vue'
8290
import IconDotsGrid from 'vue-material-design-icons/DotsGrid.vue'
8391
import AppItem from './AppItem.vue'
8492
import logger from '../logger.js'
@@ -91,6 +99,7 @@ export default defineComponent({
9199
92100
components: {
93101
AppItem,
102+
IconCog,
94103
IconDotsGrid,
95104
NcButton,
96105
NcPopover,
@@ -172,17 +181,6 @@ export default defineComponent({
172181
: this.currentApp.name
173182
},
174183
175-
// Match the collapsed label: a generic cog for any settings
176-
// sub-section instead of the per-section icon.
177-
displayIcon(): string {
178-
if (!this.currentApp) {
179-
return ''
180-
}
181-
return this.currentApp.type === 'settings'
182-
? imagePath('core', 'actions/settings-dark.svg')
183-
: this.currentApp.icon
184-
},
185-
186184
// aria-label overrides the inner span text, so the displayed name
187185
// has to be duplicated here for screen readers.
188186
currentAppLabel(): string {
@@ -466,12 +464,10 @@ export default defineComponent({
466464
// Theme-aware inversion + vertical alpha fade via --header-menu-icon-mask.
467465
filter: var(--background-image-invert-if-bright);
468466
mask: var(--header-menu-icon-mask);
467+
}
469468
470-
// Settings icons ship dark (designed for the white settings sidebar);
471-
// force-white so they read against the themed header.
472-
&--settings {
473-
filter: brightness(0) invert(1);
474-
}
469+
&__current-app-cog {
470+
mask: var(--header-menu-icon-mask);
475471
}
476472
477473
&__current-app-name {

dist/core-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)