From 0c8cd392dd866e62b595054060ae26e2fde65010 Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 5 Aug 2021 15:32:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E5=88=87=E6=8D=A2=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/Preview.vue | 2 +- src/renderer/plugins/status-bar-presentation.ts | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/Preview.vue b/src/renderer/components/Preview.vue index 9359099f..dbc4c591 100644 --- a/src/renderer/components/Preview.vue +++ b/src/renderer/components/Preview.vue @@ -32,7 +32,7 @@ -
TOP
+
TOP
diff --git a/src/renderer/plugins/status-bar-presentation.ts b/src/renderer/plugins/status-bar-presentation.ts index 8bcfea3f..c007b56f 100644 --- a/src/renderer/plugins/status-bar-presentation.ts +++ b/src/renderer/plugins/status-bar-presentation.ts @@ -1,6 +1,4 @@ -import store from '@fe/support/store' -import { Plugin } from '@fe/context/plugin' -import { Escape, getKeysLabel } from '@fe/context/shortcut' +import type { Plugin } from '@fe/context/plugin' export default { name: 'status-bar-presentation', @@ -9,7 +7,10 @@ export default { if (flag) { ctx.ui.useToast().show('info', '按下 Esc 键退出演示模式') } - store.commit('setPresentation', flag) + ctx.store.commit('setPresentation', flag) + setTimeout(() => { + ctx.bus.emit('global.resize') + }, 0) } const enterPresentation = ctx.action.registerAction({ @@ -21,10 +22,10 @@ export default { ctx.action.registerAction({ name: 'status-bar.exit-presentation', handler: () => present(false), - keys: [Escape], + keys: [ctx.shortcut.Escape], when: () => { const el = window.document.activeElement - return store.state.presentation && + return ctx.store.state.presentation && el?.tagName !== 'INPUT' && el?.tagName !== 'TEXTAREA' && [...document.body.children] // 判断页面是否有浮层遮住 @@ -37,7 +38,7 @@ export default { menus['status-bar-presentation'] = { id: 'status-bar-presentation', position: 'right', - tips: `预览 (${getKeysLabel(enterPresentation.name)})`, + tips: `预览 (${ctx.shortcut.getKeysLabel(enterPresentation.name)})`, icon: 'presentation', onClick: () => present(true) }