feat(host): 导出 schemastery Config -> DSH 设置页出现悬浮窗配置卡片;实测 profile config 经 apply(ctx,config) 下发到浮窗;README 补设置入口说明

This commit is contained in:
2026-09-27 14:52:08 +08:00
parent c3ca013d20
commit 8b74c2d2b4
3 changed files with 77 additions and 1 deletions
+16
View File
@@ -654,9 +654,25 @@
if (c === 'show') document.body.style.visibility = 'visible'
}
let settingsApplied = false
function applyDshSettings(s) {
if (!s) return
// DSH 设置页里的值 → 只应用一次,之后以浮窗自己的开关为准,避免来回打架
const want = {}
if (s.opacity != null && Math.abs(s.opacity - S.opacity) > 0.01) { S.opacity = s.opacity; cmd('opacity', { value: s.opacity }) }
if (s.scale != null && Math.abs(s.scale - S.scale) > 0.01) { S.scale = s.scale; cmd('scale', { value: s.scale }) }
if (s.backdrop && s.backdrop !== S.backdrop) { S.backdrop = s.backdrop; cmd('backdrop', { value: s.backdrop }) }
if (s.topmost != null && !!s.topmost !== !!S.topmost) cmd('topmost')
if (s.posLock != null && !!s.posLock !== !!S.posLock) cmd('posLock')
if (s.sizeLock != null && !!s.sizeLock !== !!S.sizeLock) cmd('sizeLock')
if (s.exclude != null && !!s.exclude !== !!S.exclude) cmd('exclude')
paint()
}
function render(msg) {
if (!msg) return
if (msg.type === 'cmd') return handleCmd(msg.cmd)
if (msg.settings && !settingsApplied) { settingsApplied = true; applyDshSettings(msg.settings) }
if (msg.metrics) metrics(msg.metrics)
if (msg.messages) messages(msg.messages)
if (msg.title) {