diff --git a/src/hooks/useSlideTheme.ts b/src/hooks/useSlideTheme.ts index 80188db6..d130cca9 100644 --- a/src/hooks/useSlideTheme.ts +++ b/src/hooks/useSlideTheme.ts @@ -129,9 +129,9 @@ export default () => { } // 将当前主题配置应用到全部页面 - const applyThemeToAllSlides = () => { + const applyThemeToAllSlides = (applyAll = false) => { const newSlides: Slide[] = JSON.parse(JSON.stringify(slides.value)) - const { themeColor, backgroundColor, fontColor, fontName } = theme.value + const { themeColor, backgroundColor, fontColor, fontName, outline, shadow } = theme.value for (const slide of newSlides) { if (!slide.background || slide.background.type !== 'image') { @@ -142,6 +142,11 @@ export default () => { } for (const el of slide.elements) { + if (applyAll) { + if ('outline' in el && el.outline) el.outline = outline + if ('shadow' in el && el.shadow) el.shadow = shadow + } + if (el.type === 'shape') el.fill = themeColor else if (el.type === 'line') el.color = themeColor else if (el.type === 'text') { diff --git a/src/mocks/theme.ts b/src/mocks/theme.ts index eafbdf6f..8749f692 100644 --- a/src/mocks/theme.ts +++ b/src/mocks/theme.ts @@ -5,4 +5,15 @@ export const theme: SlideTheme = { fontColor: '#333', fontName: 'Microsoft Yahei', backgroundColor: '#fff', + shadow: { + h: 3, + v: 3, + blur: 2, + color: '#808080', + }, + outline: { + width: 2, + color: '#525252', + style: 'solid', + }, } \ No newline at end of file diff --git a/src/types/slides.ts b/src/types/slides.ts index a5a8c7a5..0df49c2f 100644 --- a/src/types/slides.ts +++ b/src/types/slides.ts @@ -694,4 +694,6 @@ export interface SlideTheme { themeColor: string fontColor: string fontName: string + outline: PPTElementOutline + shadow: PPTElementShadow } diff --git a/src/views/Editor/Toolbar/SlideDesignPanel.vue b/src/views/Editor/Toolbar/SlideDesignPanel.vue index 89ecd829..cd319301 100644 --- a/src/views/Editor/Toolbar/SlideDesignPanel.vue +++ b/src/views/Editor/Toolbar/SlideDesignPanel.vue @@ -119,7 +119,14 @@ -
全局主题
+
+ 全局主题 + + 更多 + + + +
字体: