* 从数据库加载配置并启动监听
()
| 68 | * 从数据库加载配置并启动监听 |
| 69 | */ |
| 70 | private loadConfig(): void { |
| 71 | try { |
| 72 | const data = databaseAPI.dbGet('settings-general') |
| 73 | if (data) { |
| 74 | this.config = { |
| 75 | enabled: data.superPanelEnabled ?? false, |
| 76 | mouseButton: data.superPanelMouseButton ?? 'middle', |
| 77 | longPressMs: data.superPanelLongPressMs ?? 500, |
| 78 | blockedApps: data.superPanelBlockedApps ?? [] |
| 79 | } |
| 80 | if (this.config.enabled) { |
| 81 | this.startMonitor() |
| 82 | } |
| 83 | console.log('[SuperPanel] 超级面板配置已加载:', this.config) |
| 84 | } |
| 85 | } catch (error) { |
| 86 | console.error('[SuperPanel] 加载超级面板配置失败:', error) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * 设置变更时调用(从设置页面触发) |
no test coverage detected