This commit is contained in:
Mark Gregory
2026-10-21 15:16:44 +01:00
parent df3936c553
commit ed5bf665b9
33 changed files with 74 additions and 190 deletions
+28 -2
View File
@@ -18,7 +18,32 @@ struct MonitorMenuView: View {
}
}.padding(14)
Divider()
Text("SERVERS").font(.caption.bold()).foregroundStyle(.secondary).padding(.horizontal, 14).padding(.top, 12)
HStack {
Text("SERVERS")
.font(.caption.bold())
.foregroundStyle(.secondary)
Spacer()
Menu {
ForEach(monitor.servers) { server in
Button {
monitor.select(server.id)
} label: {
if server.id == monitor.selectedID {
Label(server.name, systemImage: "checkmark")
} else {
Text(server.name)
}
}
}
} label: {
Label("Switch Server", systemImage: "chevron.down.circle")
.font(.caption)
}
}
.padding(.horizontal, 14)
.padding(.top, 12)
ScrollView {
LazyVStack(spacing: 2) {
ForEach(monitor.servers) { server in
@@ -48,7 +73,8 @@ struct MonitorMenuView: View {
}.buttonStyle(.plain)
}
}
}.frame(maxHeight: 175)
}
.frame(height: min(CGFloat(max(monitor.servers.count, 1)) * 58, 175))
Divider()
if let selected = monitor.selected {
HStack {