2727import router from ' @/router'
2828import { nextTick , ref , watch } from ' vue'
2929import { ipc , store , track , i18n } from ' ./electron'
30- import { useAppStore } from ' ./store/app'
30+ import { EDITOR_DEFAULTS , useAppStore } from ' ./store/app'
3131import { repository } from ' ../../package.json'
3232import { useSnippetStore } from ' ./store/snippets'
3333import {
@@ -48,7 +48,6 @@ import {
4848 useSupportNotification ,
4949 checkForRemoteNotification
5050} from ' @/composable/notification'
51- import { useKeyMap } from ' @/composable/keymap'
5251
5352// По какой то причине необходимо явно установить роут в '/'
5453// для корректного поведения в продакшен сборке
@@ -98,7 +97,6 @@ const init = async () => {
9897
9998 trackAppUpdate ()
10099 checkForRemoteNotification ()
101- useKeyMap ()
102100}
103101
104102const setTheme = (theme : string ) => {
@@ -148,6 +146,14 @@ watch(
148146 }
149147)
150148
149+ watch (
150+ () => appStore .editor ,
151+ v => {
152+ store .preferences .set (' editor' , { ... v })
153+ },
154+ { deep: true }
155+ )
156+
151157ipc .on (' main:update-available' , () => {
152158 isUpdateAvailable .value = true
153159})
@@ -210,6 +216,22 @@ ipc.on('main-menu:add-description', async () => {
210216 await onAddDescription ()
211217})
212218
219+ ipc .on (' main-menu:font-size-increase' , async () => {
220+ appStore .editor .fontSize += 1
221+ emitter .emit (' editor:refresh' , true )
222+ })
223+
224+ ipc .on (' main-menu:font-size-decrease' , async () => {
225+ if (appStore .editor .fontSize === 1 ) return
226+ appStore .editor .fontSize -= 1
227+ emitter .emit (' editor:refresh' , true )
228+ })
229+
230+ ipc .on (' main-menu:font-size-reset' , async () => {
231+ appStore .editor .fontSize = EDITOR_DEFAULTS .fontSize
232+ emitter .emit (' editor:refresh' , true )
233+ })
234+
213235ipc .on (' api:snippet-create' , (event , body : Snippet ) => {
214236 onCreateSnippet (body )
215237})
0 commit comments