Add theme logo option (#4996)

This commit is contained in:
the1812 2025-04-01 08:47:28 +08:00
parent 5b199169b9
commit 1d1246eb4a
2 changed files with 27 additions and 4 deletions

View File

@ -58,7 +58,11 @@ const options = defineOptionsMetadata({
}, },
seasonLogo: { seasonLogo: {
defaultValue: false, defaultValue: false,
displayName: '使用季节Logo', displayName: '使用季节 Logo',
},
themeLogo: {
defaultValue: true,
displayName: '使用主题色 Logo',
}, },
touch: { touch: {
defaultValue: false, defaultValue: false,

View File

@ -1,6 +1,11 @@
<template> <template>
<div class="custom-navbar-logo-container"> <div class="custom-navbar-logo-container">
<VIcon v-if="!seasonLogoUrl" icon="logo" class="custom-navbar-logo"></VIcon> <VIcon
v-if="!seasonLogoUrl"
icon="logo"
class="custom-navbar-logo"
:class="{ theme: useThemeColor }"
></VIcon>
<div <div
v-else v-else
class="custom-navbar-logo season" class="custom-navbar-logo season"
@ -22,6 +27,7 @@ export default Vue.extend({
data() { data() {
return { return {
seasonLogoUrl: '', seasonLogoUrl: '',
useThemeColor: true,
} }
}, },
watch: { watch: {
@ -46,6 +52,13 @@ export default Vue.extend({
}, },
true, true,
) )
addComponentListener(
'customNavbar.themeLogo',
async (value: boolean) => {
this.useThemeColor = value
},
true,
)
}, },
}) })
</script> </script>
@ -63,9 +76,15 @@ export default Vue.extend({
width: calc(var(--navbar-height) * 1.3); width: calc(var(--navbar-height) * 1.3);
} }
.custom-navbar-logo { .custom-navbar-logo {
.custom-navbar:not(.fill) & { .custom-navbar:not(.fill) &:not(.season) {
&:not(.season) { body.dark & {
color: #fff;
}
&.theme {
color: var(--theme-color); color: var(--theme-color);
body.dark & {
color: var(--theme-color);
}
} }
} }
&.be-icon { &.be-icon {