Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions core/src/components/AppMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@
:aria-expanded="opened ? 'true' : 'false'"
@click="onTriggerClick('currentApp')">
<template #icon>
<!-- Settings sub-sections share one generic cog. An inline MDI icon
inherits the button's currentColor (--color-background-plain-text),
so it stays legible on both bright and dark headers without a filter. -->
<IconCog
v-if="currentApp.type === 'settings'"
class="app-menu__current-app-cog"
:size="20" />
<img
v-else
class="app-menu__current-app-icon"
:class="{ 'app-menu__current-app-icon--settings': currentApp.type === 'settings' }"
:src="displayIcon"
:src="currentApp.icon"
alt=""
aria-hidden="true">
</template>
Expand All @@ -79,6 +86,7 @@ import { generateUrl, imagePath } from '@nextcloud/router'
import { defineComponent, ref } from 'vue'
import NcButton from '@nextcloud/vue/components/NcButton'
import NcPopover from '@nextcloud/vue/components/NcPopover'
import IconCog from 'vue-material-design-icons/Cog.vue'
import IconDotsGrid from 'vue-material-design-icons/DotsGrid.vue'
import AppItem from './AppItem.vue'
import logger from '../logger.js'
Expand All @@ -91,6 +99,7 @@ export default defineComponent({

components: {
AppItem,
IconCog,
IconDotsGrid,
NcButton,
NcPopover,
Expand Down Expand Up @@ -172,17 +181,6 @@ export default defineComponent({
: this.currentApp.name
},

// Match the collapsed label: a generic cog for any settings
// sub-section instead of the per-section icon.
displayIcon(): string {
if (!this.currentApp) {
return ''
}
return this.currentApp.type === 'settings'
? imagePath('core', 'actions/settings-dark.svg')
: this.currentApp.icon
},

// aria-label overrides the inner span text, so the displayed name
// has to be duplicated here for screen readers.
currentAppLabel(): string {
Expand Down Expand Up @@ -466,12 +464,10 @@ export default defineComponent({
// Theme-aware inversion + vertical alpha fade via --header-menu-icon-mask.
filter: var(--background-image-invert-if-bright);
mask: var(--header-menu-icon-mask);
}

// Settings icons ship dark (designed for the white settings sidebar);
// force-white so they read against the themed header.
&--settings {
filter: brightness(0) invert(1);
}
&__current-app-cog {
mask: var(--header-menu-icon-mask);
}

&__current-app-name {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

Loading