Improve UI

This commit is contained in:
世界
2024-02-08 10:37:37 +08:00
parent 70d43abd52
commit 1f6e99f576
32 changed files with 1201 additions and 646 deletions
+19 -13
View File
@@ -25,24 +25,30 @@ public struct SidebarView: View {
var body: some View {
VStack {
if extensionProfile.status.isConnectedStrict {
List(selection: selection) {
Section(NavigationPage.dashboard.title) {
Label("Overview", systemImage: "text.and.command.macwindow").tag(NavigationPage.dashboard)
NavigationPage.groups.label.tag(NavigationPage.groups)
viewBuilder {
if extensionProfile.status.isConnectedStrict {
List(selection: selection) {
Section(NavigationPage.dashboard.title) {
Label("Overview", systemImage: "text.and.command.macwindow")
.tint(.textColor)
.tag(NavigationPage.dashboard)
NavigationPage.groups.label.tag(NavigationPage.groups)
}
Divider()
ForEach(NavigationPage.macosDefaultPages, id: \.self) { it in
it.label
}
}
Divider()
ForEach(NavigationPage.macosDefaultPages, id: \.self) { it in
} else {
List(NavigationPage.allCases.filter { it in
it.visible(extensionProfile)
}, selection: selection) { it in
it.label
}
}
} else {
List(NavigationPage.allCases.filter { it in
it.visible(extensionProfile)
}, selection: selection) { it in
it.label
}
}
.listStyle(.sidebar)
.scrollDisabled(true)
}
.onChangeCompat(of: extensionProfile.status) {
if !selection.wrappedValue.visible(extensionProfile) {