style(menubar): 将底部操作改为一体式液态玻璃胶囊
This commit is contained in:
@@ -146,6 +146,8 @@ App 持有进程级 `KeepAwakeService`(Core/Services,MainActor + Observable
|
|||||||
|
|
||||||
状态不持久化,重启默认关闭;关闭面板、暂停资源采样均不影响已开启的保持唤醒,无额外定时器、辅助进程或权限变更。主动锁屏、主动睡眠、合盖、低电量保护与管理策略仍由系统决定;独立屏保/自动锁定策略的实际行为需在用户环境验收,不以电源断言创建成功替代锁屏实测。
|
状态不持久化,重启默认关闭;关闭面板、暂停资源采样均不影响已开启的保持唤醒,无额外定时器、辅助进程或权限变更。主动锁屏、主动睡眠、合盖、低电量保护与管理策略仍由系统决定;独立屏保/自动锁定策略的实际行为需在用户环境验收,不以电源断言创建成功替代锁屏实测。
|
||||||
|
|
||||||
面板底部四个按钮统一透明背景与圆角矩形细边框,咖啡杯开启时使用当前强调色,并提供三语帮助及无障碍开关状态。
|
面板底部四个按钮置于一个原生 `.glassEffect(.regular, in: .capsule)` 液态玻璃胶囊内,各按钮采用圆形悬停/按压反馈,退出按钮前有分隔线;咖啡杯开启时使用当前强调色,并提供三语帮助及无障碍开关状态。
|
||||||
|
|
||||||
2026-10-30 验证:Debug 构建通过;独立核心检查在普通进程与带主应用沙盒权限的临时 .app 中均通过,实际查询本进程断言,覆盖默认关闭、连续三次开关、开启后两类断言存在、关闭/服务销毁后消失。CLI 检查器直接加沙盒签名会在 libsecinit 初始化阶段退出,改用完整 .app 包后通过,未更改产品权限。当前没有 Xcode 测试 Target。UI 自动化 getApp 本轮构建超时;本轮仅退出自动化启动的测试副本,保留用户 Xcode 进程。底部实际视觉、关闭面板后长时间空闲不锁屏/息屏以及关闭开关后恢复系统策略,待用户验收。
|
2026-10-30 验证:Debug 构建通过;独立核心检查在普通进程与带主应用沙盒权限的临时 .app 中均通过,实际查询本进程断言,覆盖默认关闭、连续三次开关、开启后两类断言存在、关闭/服务销毁后消失。CLI 检查器直接加沙盒签名会在 libsecinit 初始化阶段退出,改用完整 .app 包后通过,未更改产品权限。当前没有 Xcode 测试 Target。UI 自动化 getApp 本轮构建超时;本轮仅退出自动化启动的测试副本,保留用户 Xcode 进程。底部实际视觉、关闭面板后长时间空闲不锁屏/息屏以及关闭开关后恢复系统策略,待用户验收。
|
||||||
|
|
||||||
|
底部液态玻璃样式调整:Debug 构建通过;实际面板中的玻璃质感及悬停视觉待用户重新运行验收。
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ struct MenuPanelView: View {
|
|||||||
.font(.system(size: 9)).foregroundStyle(.tertiary)
|
.font(.system(size: 9)).foregroundStyle(.tertiary)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
|
HStack(spacing: 2) {
|
||||||
Button { keepAwake.toggle() } label: {
|
Button { keepAwake.toggle() } label: {
|
||||||
Image(systemName: keepAwake.isEnabled ? "cup.and.saucer.fill" : "cup.and.saucer")
|
Image(systemName: keepAwake.isEnabled ? "cup.and.saucer.fill" : "cup.and.saucer")
|
||||||
.frame(width: 20, height: 20)
|
.frame(width: 20, height: 20)
|
||||||
@@ -213,12 +214,16 @@ struct MenuPanelView: View {
|
|||||||
Image(systemName: "gearshape").frame(width: 20, height: 20)
|
Image(systemName: "gearshape").frame(width: 20, height: 20)
|
||||||
}
|
}
|
||||||
.help(Text("action.settings")).accessibilityLabel(Text("action.settings"))
|
.help(Text("action.settings")).accessibilityLabel(Text("action.settings"))
|
||||||
|
Divider().frame(height: 18).padding(.horizontal, 3)
|
||||||
Button { NSApp.terminate(nil) } label: {
|
Button { NSApp.terminate(nil) } label: {
|
||||||
Image(systemName: "power").frame(width: 20, height: 20)
|
Image(systemName: "power").frame(width: 20, height: 20)
|
||||||
}
|
}
|
||||||
.help(Text("action.quit")).accessibilityLabel(Text("action.quit"))
|
.help(Text("action.quit")).accessibilityLabel(Text("action.quit"))
|
||||||
}
|
}
|
||||||
.buttonStyle(FooterButtonStyle())
|
.buttonStyle(FooterButtonStyle())
|
||||||
|
.padding(4)
|
||||||
|
.glassEffect(.regular, in: .capsule)
|
||||||
|
}
|
||||||
.controlSize(.small)
|
.controlSize(.small)
|
||||||
.padding(.horizontal, 8).padding(.vertical, 6)
|
.padding(.horizontal, 8).padding(.vertical, 6)
|
||||||
}
|
}
|
||||||
@@ -227,13 +232,24 @@ struct MenuPanelView: View {
|
|||||||
|
|
||||||
private struct FooterButtonStyle: ButtonStyle {
|
private struct FooterButtonStyle: ButtonStyle {
|
||||||
func makeBody(configuration: Configuration) -> some View {
|
func makeBody(configuration: Configuration) -> some View {
|
||||||
|
FooterButtonBody(isPressed: configuration.isPressed) {
|
||||||
configuration.label
|
configuration.label
|
||||||
.padding(.horizontal, 9).padding(.vertical, 6)
|
|
||||||
.contentShape(RoundedRectangle(cornerRadius: 6))
|
|
||||||
.overlay {
|
|
||||||
RoundedRectangle(cornerRadius: 6)
|
|
||||||
.strokeBorder(.primary.opacity(configuration.isPressed ? 0.5 : 0.18), lineWidth: 1)
|
|
||||||
}
|
}
|
||||||
.opacity(configuration.isPressed ? 0.6 : 1)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private struct FooterButtonBody<Content: View>: View {
|
||||||
|
let isPressed: Bool
|
||||||
|
@ViewBuilder var content: () -> Content
|
||||||
|
@State private var isHovered = false
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
content()
|
||||||
|
.frame(width: 34, height: 34)
|
||||||
|
.background {
|
||||||
|
Circle().fill(.primary.opacity(isPressed ? 0.16 : (isHovered ? 0.08 : 0)))
|
||||||
|
}
|
||||||
|
.contentShape(Circle())
|
||||||
|
.onHover { isHovered = $0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user