fix: add windows outline border back on macOS

This commit is contained in:
tiny-craft 2023-10-28 22:59:47 +08:00
parent faad24d1d5
commit d0af3deaeb
3 changed files with 29 additions and 29 deletions

View File

@ -54,42 +54,38 @@ watch(
}, },
) )
const border = computed(() => {
return isMacOS() ? 'none' : `1px solid ${themeVars.value.borderColor}`
})
const logoWrapperWidth = computed(() => { const logoWrapperWidth = computed(() => {
return `${data.navMenuWidth + prefStore.behavior.asideWidth - 4}px` return `${data.navMenuWidth + prefStore.behavior.asideWidth - 4}px`
}) })
const borderRadius = ref(10)
const logoPaddingLeft = ref(10) const logoPaddingLeft = ref(10)
const maximised = ref(false) const maximised = ref(false)
const toggleWindowRadius = (on) => { const hideRadius = ref(false)
borderRadius.value = on ? 10 : 0 const wrapperStyle = computed(() => {
} return hideRadius.value
? {}
: {
border: `1px solid ${themeVars.value.borderColor}`,
borderRadius: '10px',
}
})
const onToggleFullscreen = (fullscreen) => { const onToggleFullscreen = (fullscreen) => {
hideRadius.value = fullscreen
if (fullscreen) { if (fullscreen) {
logoPaddingLeft.value = 10 logoPaddingLeft.value = 10
toggleWindowRadius(false)
} else { } else {
logoPaddingLeft.value = isMacOS() ? 70 : 10 logoPaddingLeft.value = isMacOS() ? 70 : 10
toggleWindowRadius(true)
} }
} }
const onToggleMaximize = (isMaximised) => { const onToggleMaximize = (isMaximised) => {
if (isMaximised) { if (isMaximised) {
maximised.value = true maximised.value = true
if (!isMacOS()) { hideRadius.value = isMacOS()
toggleWindowRadius(false)
}
} else { } else {
maximised.value = false maximised.value = false
if (!isMacOS()) { hideRadius.value = !isMacOS()
toggleWindowRadius(true)
}
} }
} }
@ -111,9 +107,9 @@ onMounted(async () => {
<!-- app content--> <!-- app content-->
<n-spin <n-spin
:show="props.loading" :show="props.loading"
:style="{ borderRadius: `${borderRadius}px`, border }" :theme-overrides="{ opacitySpinning: 0 }"
:theme-overrides="{ opacitySpinning: 0 }"> :style="{ backgroundColor: themeVars.bodyColor }">
<div id="app-content-wrapper" :style="{ color: themeVars.textColorBase }" class="flex-box-v"> <div id="app-content-wrapper" :style="wrapperStyle" class="flex-box-v">
<!-- title bar --> <!-- title bar -->
<div <div
id="app-toolbar" id="app-toolbar"
@ -209,8 +205,8 @@ onMounted(async () => {
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
border-radius: 8px;
background-color: v-bind('themeVars.bodyColor'); background-color: v-bind('themeVars.bodyColor');
color: v-bind('themeVars.textColorBase');
#app-toolbar { #app-toolbar {
background-color: v-bind('exThemeVars.titleColor'); background-color: v-bind('exThemeVars.titleColor');

View File

@ -10,9 +10,9 @@
* @type ExtraTheme * @type ExtraTheme
*/ */
export const extraLightTheme = { export const extraLightTheme = {
titleColor: '#F0F0F4', titleColor: '#F2F2F2',
sidebarColor: '#F6F6F6', sidebarColor: '#E9E9E9',
splitColor: '#E0E0E6', splitColor: '#DADADA',
} }
/** /**
@ -20,9 +20,9 @@ export const extraLightTheme = {
* @type ExtraTheme * @type ExtraTheme
*/ */
export const extraDarkTheme = { export const extraDarkTheme = {
titleColor: '#202020', titleColor: '#363636',
sidebarColor: '#202124', sidebarColor: '#262626',
splitColor: '#323138', splitColor: '#474747',
} }
/** /**

View File

@ -54,15 +54,19 @@ export const themeOverrides = {
*/ */
const _darkThemeOverrides = { const _darkThemeOverrides = {
common: { common: {
bodyColor: '#1A1A1A', bodyColor: '#1E1E1E',
tabColor: '#18181C', tabColor: '#1E1E1E',
borderColor: '#515151',
}, },
Tree: { Tree: {
nodeTextColor: '#ceced0', nodeTextColor: '#CECED0',
}, },
Card: { Card: {
colorEmbedded: '#18181C', colorEmbedded: '#18181C',
}, },
Dropdown: {
color: '#272727',
},
} }
export const darkThemeOverrides = merge({}, themeOverrides, _darkThemeOverrides) export const darkThemeOverrides = merge({}, themeOverrides, _darkThemeOverrides)