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