fix(desktop): 设置窗口尺寸回归内容实际大小 + 原生贴形阴影 + 红绿灯对齐 + 显式拖拽权限(12A 实测反馈)
- 去掉 16px CSS 阴影边距方案(窗口比观感大、外圈灰影、点击区域错位):
transparent 窗口开 macOS 原生阴影,阴影贴合内容圆角,窗口 440x560
即卡片本体
- trafficLightPosition {16,12}:红绿灯垂直居中于 36px 自绘顶条,与
「dudu 设置」标题对齐
- capabilities 显式加 core:window:allow-start-dragging,保证
data-tauri-drag-region 拖拽可用
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,17 @@
|
|||||||
"$schema": "../gen/schemas/desktop-schema.json",
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
"identifier": "default",
|
"identifier": "default",
|
||||||
"description": "所有窗口的基础能力:核心 IPC(invoke/listen)+ 全局快捷键",
|
"description": "所有窗口的基础能力:核心 IPC(invoke/listen)+ 全局快捷键",
|
||||||
"windows": ["settings", "overlay", "tray", "login", "feedback", "onboarding"],
|
"windows": [
|
||||||
"permissions": ["core:default", "global-shortcut:default"]
|
"settings",
|
||||||
|
"overlay",
|
||||||
|
"tray",
|
||||||
|
"login",
|
||||||
|
"feedback",
|
||||||
|
"onboarding"
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
"core:default",
|
||||||
|
"global-shortcut:default",
|
||||||
|
"core:window:allow-start-dragging"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"default":{"identifier":"default","description":"所有窗口的基础能力:核心 IPC(invoke/listen)+ 全局快捷键","local":true,"windows":["settings","overlay","tray","login","feedback","onboarding"],"permissions":["core:default","global-shortcut:default"]}}
|
{"default":{"identifier":"default","description":"所有窗口的基础能力:核心 IPC(invoke/listen)+ 全局快捷键","local":true,"windows":["settings","overlay","tray","login","feedback","onboarding"],"permissions":["core:default","global-shortcut:default","core:window:allow-start-dragging"]}}
|
||||||
@@ -15,17 +15,17 @@
|
|||||||
"label": "settings",
|
"label": "settings",
|
||||||
"title": "dudu 设置",
|
"title": "dudu 设置",
|
||||||
"url": "index.html",
|
"url": "index.html",
|
||||||
"width": 472,
|
"width": 440,
|
||||||
"height": 592,
|
"height": 560,
|
||||||
"resizable": false,
|
"resizable": false,
|
||||||
"visible": false,
|
"visible": false,
|
||||||
"titleBarStyle": "Overlay",
|
"titleBarStyle": "Overlay",
|
||||||
"hiddenTitle": true,
|
"hiddenTitle": true,
|
||||||
"transparent": true,
|
"transparent": true,
|
||||||
"shadow": false,
|
"shadow": true,
|
||||||
"trafficLightPosition": {
|
"trafficLightPosition": {
|
||||||
"x": 30,
|
"x": 16,
|
||||||
"y": 28
|
"y": 12
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,12 +61,13 @@ export function SettingsApp() {
|
|||||||
const trialUsedMin = me ? Math.floor(me.trial_used_today / 60) : 0;
|
const trialUsedMin = me ? Math.floor(me.trial_used_today / 60) : 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// 透明窗口自绘 MacWindow 框(对齐原型):16px 阴影边距 + radius-md + border + shadow-window。
|
// 透明窗口自绘 MacWindow 框(对齐原型):radius-md + border-1,占满窗口,
|
||||||
|
// 阴影用 macOS 原生(贴合内容圆角,窗口即卡片实际尺寸)。
|
||||||
// 原生 NSWindow 底色在深色内容外露白边,故窗口 transparent、框由页面画。
|
// 原生 NSWindow 底色在深色内容外露白边,故窗口 transparent、框由页面画。
|
||||||
<div style={{
|
<div style={{
|
||||||
fontFamily: 'var(--font-sans)', position: 'fixed', inset: 16,
|
fontFamily: 'var(--font-sans)', position: 'fixed', inset: 0,
|
||||||
background: 'var(--bg-app)', borderRadius: 'var(--radius-md)',
|
background: 'var(--bg-app)', borderRadius: 'var(--radius-md)',
|
||||||
border: '1px solid var(--border-1)', boxShadow: 'var(--shadow-window)',
|
border: '1px solid var(--border-1)',
|
||||||
overflow: 'hidden', display: 'flex', flexDirection: 'column',
|
overflow: 'hidden', display: 'flex', flexDirection: 'column',
|
||||||
}}>
|
}}>
|
||||||
{/* 自绘顶条:系统红绿灯悬浮于左上(trafficLightPosition 已对齐),留 76px;整条可拖拽 */}
|
{/* 自绘顶条:系统红绿灯悬浮于左上(trafficLightPosition 已对齐),留 76px;整条可拖拽 */}
|
||||||
|
|||||||
Reference in New Issue
Block a user