MCPcopy
hub / github.com/ZToolsCenter/ZTools / savePosition

Method savePosition

src/main/core/floatingBallManager.ts:272–285  ·  view source on GitHub ↗

* 保存悬浮球位置到数据库

()

Source from the content-addressed store, hash-verified

270 * 保存悬浮球位置到数据库
271 */
272 private savePosition(): void {
273 if (!this.ballWindow || this.ballWindow.isDestroyed()) return
274
275 const [x, y] = this.ballWindow.getPosition()
276
277 try {
278 const data = databaseAPI.dbGet('settings-general') || {}
279 data.floatingBallPosition = { x, y }
280 databaseAPI.dbPut('settings-general', data)
281 console.log('[FloatingBall] 悬浮球位置已保存:', { x, y })
282 } catch (error) {
283 console.error('[FloatingBall] 保存悬浮球位置失败:', error)
284 }
285 }
286
287 /**
288 * 显示右键菜单

Callers 1

setupIPCMethod · 0.95

Calls 2

dbGetMethod · 0.45
dbPutMethod · 0.45

Tested by

no test coverage detected