Fixes
This commit is contained in:
@@ -61,7 +61,9 @@ public struct ConnectionListView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if os(macOS)
|
||||
.searchable(text: $searchText)
|
||||
#endif
|
||||
.alertBinding($alert)
|
||||
.onAppear {
|
||||
connect()
|
||||
|
||||
@@ -50,23 +50,25 @@ public struct ActiveDashboardView: View {
|
||||
VStack {
|
||||
#if os(iOS) || os(tvOS)
|
||||
if ApplicationLibrary.inPreview || profile.status.isConnectedStrict {
|
||||
viewBuilder {
|
||||
#if os(iOS)
|
||||
if #available(iOS 16.0, *) {
|
||||
content1
|
||||
} else {
|
||||
content0
|
||||
Picker("Page", selection: $selection) {
|
||||
ForEach(DashboardPage.allCases) { page in
|
||||
page.label
|
||||
}
|
||||
#else
|
||||
content0
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
#if os(iOS)
|
||||
.padding([.leading, .trailing])
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
TabView(selection: $selection) {
|
||||
ForEach(DashboardPage.enabledCases) { page in
|
||||
page.contentView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
|
||||
.tag(page)
|
||||
}
|
||||
}
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
.onAppear {
|
||||
UIScrollView.appearance().isScrollEnabled = false
|
||||
}
|
||||
.tabViewStyle(.page(indexDisplayMode: .never))
|
||||
} else {
|
||||
OverviewView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
|
||||
@@ -91,46 +93,6 @@ public struct ActiveDashboardView: View {
|
||||
.alertBinding($alert)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var content0: some View {
|
||||
Picker("Page", selection: $selection) {
|
||||
ForEach(DashboardPage.allCases) { page in
|
||||
page.label
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
#if os(iOS)
|
||||
.padding([.leading, .trailing])
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
TabView(selection: $selection) {
|
||||
ForEach(DashboardPage.enabledCases) { page in
|
||||
page.contentView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
|
||||
.tag(page)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 16.0, *)
|
||||
@ViewBuilder
|
||||
private var content1: some View {
|
||||
TabView(selection: $selection) {
|
||||
ForEach(DashboardPage.enabledCases) { page in
|
||||
page.contentView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
|
||||
.tag(page)
|
||||
}
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarTitleMenu {
|
||||
Picker("Page", selection: $selection) {
|
||||
ForEach(DashboardPage.allCases) { page in
|
||||
page.label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func doReload() async {
|
||||
defer {
|
||||
isLoading = false
|
||||
|
||||
@@ -13,7 +13,7 @@ public enum DashboardPage: Int, CaseIterable, Identifiable {
|
||||
}
|
||||
|
||||
public extension DashboardPage {
|
||||
#if !os(tvOS)
|
||||
#if !tvOS
|
||||
static var enabledCases: [DashboardPage] = [
|
||||
.overview,
|
||||
.groups,
|
||||
|
||||
Reference in New Issue
Block a user