Skip to content

Commit

Permalink
feat: insert slide from ToolBar (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
devlzl authored Jan 13, 2024
1 parent 286e746 commit 3dd16de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/Kernel/SlideManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class SlideManager {

insertSlide(index: number = this._currentIndex + 1) {
this._slides.splice(index, 0, new Slide())
this.changeSlide(index)
this.events.update.emit()
}

Expand Down
9 changes: 5 additions & 4 deletions src/UserInterface/ToolBar/components/Home/Slides.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<script setup lang="ts">
import { Slide, Copy } from '@icon-park/vue-next'
import MenuWrapper from '../MenuWrapper.vue'
import { slideManager } from '@Kernel/index'
</script>

<template>
<MenuWrapper :name="$t('ToolBar.home.slides.title')">
<div class="flex items-start">
<button class="menu-btn flex flex-col items-center">
<slide theme="multi-color" size="32" :fill="['#333', '#FFF', '#379E4E', '#379E4E']" :strokeWidth="2" />
<button class="menu-btn flex flex-col items-center" @click="slideManager.insertSlide()">
<Slide theme="multi-color" size="32" :fill="['#333', '#FFF', '#379E4E', '#379E4E']" :strokeWidth="2" />
<span class="text-xs mt-1">{{ $t('ToolBar.home.slides.add') }}</span>
</button>
<button class="menu-btn py-1">
<!-- <button class="menu-btn py-1">
<copy theme="two-tone" size="18" :fill="['#333', '#DE6C00']" :strokeWidth="2" />
<span class="text-xs ml-1">{{ $t('ToolBar.home.slides.duplicate') }}</span>
</button>
</button> -->
</div>
</MenuWrapper>
</template>
11 changes: 4 additions & 7 deletions src/UserInterface/ToolBar/components/Insert/Slides.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<script setup lang="ts">
import { FileAdditionOne, Down } from '@icon-park/vue-next'
import { Slide } from '@icon-park/vue-next'
import { slideManager } from '@Kernel/index'
import MenuWrapper from '../MenuWrapper.vue'
</script>

<template>
<MenuWrapper :name="$t('ToolBar.insert.slides.title')">
<button class="flex flex-col items-center py-0 menu-btn">
<span class="text-xs">{{ $t('ToolBar.insert.slides.add') }}</span>
<Down class="-mt-1" theme="outline" size="17" fill="#333" :strokeWidth="2" />
</button>
<button class="flex flex-col items-center px-4 menu-btn" @click="slideManager.insertSlide()">
<FileAdditionOne theme="outline" size="32" fill="#333" :strokeWidth="2" />
<button class="menu-btn flex flex-col items-center" @click="slideManager.insertSlide()">
<Slide theme="multi-color" size="32" :fill="['#333', '#FFF', '#379E4E', '#379E4E']" :strokeWidth="2" />
<span class="text-xs mt-1">{{ $t('ToolBar.home.slides.add') }}</span>
</button>
</MenuWrapper>
</template>

0 comments on commit 3dd16de

Please sign in to comment.