refactor(menubar): 将刷新间隔移至底栏并恢复顶部单行
This commit is contained in:
@@ -139,9 +139,9 @@ struct MenuPanelView: View {
|
||||
}
|
||||
.frame(height: 32)
|
||||
.overlay {
|
||||
if panelSize.width >= 840 { pagePicker }
|
||||
if panelSize.width >= 560 { pagePicker }
|
||||
}
|
||||
if panelSize.width < 840 { pagePicker.frame(maxWidth: .infinity).frame(height: 28) }
|
||||
if panelSize.width < 560 { pagePicker.frame(maxWidth: .infinity).frame(height: 28) }
|
||||
}
|
||||
.frame(height: PanelLayout.headerHeight(width: panelSize.width))
|
||||
.padding(.horizontal, 4)
|
||||
@@ -151,24 +151,27 @@ struct MenuPanelView: View {
|
||||
HStack {
|
||||
Text(verbatim: HardwareIdentity.displayName)
|
||||
.lineLimit(1).truncationMode(.middle)
|
||||
.help(Text(verbatim: HardwareIdentity.displayName))
|
||||
Spacer(minLength: 8)
|
||||
HStack(spacing: 4) {
|
||||
Text("panel.uptime")
|
||||
MetricText(value: String(format: "%.1f h", snapshot.uptime / 3600))
|
||||
}.fixedSize()
|
||||
Divider().frame(height: 14)
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "timer").help(Text("sampling.panel"))
|
||||
IntervalControl(milliseconds: Binding(get: { metrics.sampling.panelMilliseconds }, set: { metrics.sampling.panelMilliseconds = $0 }))
|
||||
}
|
||||
.foregroundStyle(.primary)
|
||||
.accessibilityLabel(Text("sampling.panel"))
|
||||
}
|
||||
.font(PanelStyle.label).foregroundStyle(.secondary)
|
||||
.frame(height: 18).padding(.horizontal, 4)
|
||||
.frame(height: PanelLayout.footerHeight).padding(.horizontal, 4)
|
||||
}
|
||||
|
||||
private var controls: some View {
|
||||
HStack(spacing: 8) {
|
||||
HStack(spacing: 2) {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "timer").help(Text("sampling.panel"))
|
||||
IntervalControl(milliseconds: Binding(get: { metrics.sampling.panelMilliseconds }, set: { metrics.sampling.panelMilliseconds = $0 }))
|
||||
}.padding(.horizontal, 6).accessibilityLabel(Text("sampling.panel"))
|
||||
Divider().frame(height: 18).padding(.horizontal, 3)
|
||||
Button { presentation.isPinned.toggle() } label: {
|
||||
Image(systemName: presentation.isPinned ? "pin.fill" : "pin")
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Reference in New Issue
Block a user