Skip to content

Commit

Permalink
新增:快捷面板开关和快捷键配置
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Dec 25, 2024
1 parent 6a219df commit 609acd4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## v0.3.0

- 新增:快捷面板开关和快捷键配置
- 新增:插件管理隐藏系统插件版本
- 新增:工单反馈功能,便于解决问题
- 新增:setting.darkModeSupport 配置项,默认为false
Expand Down
4 changes: 4 additions & 0 deletions electron/mapi/manager/hotkey/handle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {ManagerPluginEvent} from "../plugin/event";
import {ManagerConfig} from "../config/config";
import ConfigMain from "../../config/main";


export const ManagerHotkeyHandle = {
Expand All @@ -11,6 +12,9 @@ export const ManagerHotkeyHandle = {
}
},
async fastPanelTrigger() {
if (!await ConfigMain.get('fastPanelEnable', true)) {
return
}
if (await ManagerPluginEvent.isFastPanelWindowShown(null, null)) {
await ManagerPluginEvent.hideFastPanelWindow(null, null)
} else {
Expand Down
44 changes: 38 additions & 6 deletions src/pages/System/SystemSetting.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
<script setup lang="ts">
import HotkeyInput from "./components/HotkeyInput.vue";
import {useManagerStore} from "../../store/modules/manager";
import {onMounted} from "vue";
import {onMounted, ref} from "vue";
import {useSettingStore} from "../../store/modules/setting";
const setting = useSettingStore()
const manager = useManagerStore()
onMounted(() => {
const isMacOs = focusany.isMacOs()
const isWindows = focusany.isWindows()
const isLinux = focusany.isLinux()
const fastPanelTriggerType = ref('Ctrl')
onMounted(() => {
fastPanelTriggerType.value = manager.configGet('fastPanelTrigger', null).value?.type || 'Ctrl'
})
const onManagerConfigChange = (key: string, value: any) => {
// console.log('onManagerConfigChange', key, value)
switch (key) {
case 'fastPanelTriggerType':
manager.onConfigChange('fastPanelTrigger', {type: value})
break
}
}
</script>

<template>
<div class="p-4">
<div class="mb-8">
<div class="text-base font-bold mb-4">功能设置</div>
<div class="pl-4">
<div class="flex mb-4">
<div class="flex items-center mb-6">
<div class="flex-grow">
呼出快捷键
</div>
Expand All @@ -25,7 +41,7 @@ onMounted(() => {
@change="manager.onConfigChange('mainTrigger',$event)"/>
</div>
</div>
<div class="flex mb-4">
<div class="flex items-center mb-6">
<div class="flex-grow">
主题样式
</div>
Expand All @@ -38,12 +54,28 @@ onMounted(() => {
</a-radio-group>
</div>
</div>
<div v-if="0" class="flex mb-4">
<div class="flex items-center mb-6">
<div class="flex-grow">
快捷面板
</div>
<div>
<HotkeyInput/>
<a-switch :model-value="setting.configGet('fastPanelEnable',true).value"
@change="setting.onConfigChange('fastPanelEnable',$event)"/>
</div>
</div>
<div class="flex items-center mb-6"
v-if="setting.configGet('fastPanelEnable',true).value">
<div class="flex-grow">
快捷面板呼出快捷键
</div>
<div>
<a-select :model-value="fastPanelTriggerType"
@change="onManagerConfigChange('fastPanelTriggerType',$event)">
<a-option value="Ctrl">Ctrl</a-option>
<a-option value="Alt" v-if="isWindows||isLinux">Alt</a-option>
<a-option value="Alt" v-if="isMacOs">Option</a-option>
<a-option value="Meta" v-if="isMacOs">Meta</a-option>
</a-select>
</div>
</div>
</div>
Expand Down

0 comments on commit 609acd4

Please sign in to comment.