-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #683 from nextcloud/fix/separate-menu-and-user-menu
fix(app): improve user menu design
- Loading branch information
Showing
9 changed files
with
314 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
<script setup> | ||
import { computed } from 'vue' | ||
import MdiReload from 'vue-material-design-icons/Reload.vue' | ||
import MdiWeb from 'vue-material-design-icons/Web.vue' | ||
import MdiBug from 'vue-material-design-icons/Bug.vue' | ||
import MdiInformationOutline from 'vue-material-design-icons/InformationOutline.vue' | ||
import MdiMenu from 'vue-material-design-icons/Menu.vue' | ||
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js' | ||
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' | ||
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js' | ||
import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.js' | ||
import { t } from '@nextcloud/l10n' | ||
import { generateUrl } from '@nextcloud/router' | ||
const packageInfo = window.TALK_DESKTOP.packageInfo | ||
const talkRouter = window.OCA.Talk.Desktop.talkRouter | ||
const talkWebLink = computed(() => generateUrl(talkRouter.value?.currentRoute?.fullPath ?? '')) | ||
const showHelp = () => window.TALK_DESKTOP.showHelp() | ||
const reload = () => window.location.reload() | ||
</script> | ||
<template> | ||
<NcActions :aria-label="t('talk_desktop', 'Menu')" | ||
type="tertiary-no-background" | ||
container="body"> | ||
<template #icon> | ||
<MdiMenu :size="20" /> | ||
</template> | ||
<NcActionLink :href="talkWebLink" target="_blank"> | ||
<template #icon> | ||
<MdiWeb :size="20" /> | ||
</template> | ||
{{ t('talk_desktop', 'Open in Web-Browser') }} | ||
</NcActionLink> | ||
<NcActionSeparator /> | ||
<NcActionButton @click="reload"> | ||
<template #icon> | ||
<MdiReload :size="20" /> | ||
</template> | ||
{{ t('talk_desktop', 'Force reload') }} | ||
</NcActionButton> | ||
<NcActionLink :href="packageInfo.bugs" target="_blank"> | ||
<template #icon> | ||
<MdiBug /> | ||
</template> | ||
{{ t('talk_desktop', 'Report a bug') }} | ||
</NcActionLink> | ||
<NcActionSeparator /> | ||
<NcActionButton @click="showHelp"> | ||
<template #icon> | ||
<MdiInformationOutline :size="20" /> | ||
</template> | ||
{{ t('talk_desktop', 'About') }} | ||
</NcActionButton> | ||
</NcActions> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
<script setup> | ||
import { computed } from 'vue' | ||
import { appData } from '../../../app/AppData.js' | ||
const props = defineProps({ | ||
size: { | ||
type: Number, | ||
default: 20, | ||
}, | ||
}) | ||
const theming = appData.capabilities.theming | ||
const logoUrl = theming.logo | ||
const primaryColor = theming.color | ||
const cssVars = computed(() => ({ | ||
'--ThemeLogo-size': typeof props.size === 'number' ? `${props.size}px` : props.size, | ||
'--ThemeLogo-background-color': primaryColor, | ||
})) | ||
</script> | ||
|
||
<template> | ||
<span class="theme-logo" :style="cssVars"> | ||
<img class="theme-logo__img" :src="logoUrl" alt=""> | ||
</span> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
.theme-logo { | ||
display: flex; | ||
align-items: stretch; | ||
justify-content: center; | ||
aspect-ratio: 1 / 1; | ||
border-radius: var(--border-radius); | ||
width: var(--ThemeLogo-size); | ||
height: var(--ThemeLogo-size); | ||
background-color: var(--ThemeLogo-background-color); | ||
padding: 15%; | ||
} | ||
.theme-logo__img { | ||
max-width: 100%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
<template> | ||
<li class="menu-item-separator" /> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
.menu-item-separator { | ||
border-top: 1px solid var(--color-border-dark); | ||
margin: 2px 0; | ||
} | ||
</style> |
Oops, something went wrong.