Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 12, 2024
1 parent a0282e8 commit 10481fe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 58 deletions.
2 changes: 2 additions & 0 deletions ApplicationLibrary/Views/Connections/ConnectionListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public struct ConnectionListView: View {
}
}
}
#if os(macOS)
.searchable(text: $searchText)
#endif
.alertBinding($alert)
.onAppear {
connect()
Expand Down
68 changes: 15 additions & 53 deletions ApplicationLibrary/Views/Dashboard/ActiveDashboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
#else
content0
#endif
Picker("Page", selection: $selection) {
ForEach(DashboardPage.allCases) { page in
page.label
}
}
.pickerStyle(.segmented)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
.padding([.leading, .trailing])
.navigationBarTitleDisplayMode(.inline)
#endif
.onAppear {
UIScrollView.appearance().isScrollEnabled = false
TabView(selection: $selection) {
ForEach(DashboardPage.enabledCases) { page in
page.contentView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
.tag(page)
}
}
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
.tabViewStyle(.page(indexDisplayMode: .never))
} else {
OverviewView($profileList, $selectedProfileID, $systemProxyAvailable, $systemProxyEnabled)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ApplicationLibrary/Views/Dashboard/DashboardPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public enum DashboardPage: Int, CaseIterable, Identifiable {
}

public extension DashboardPage {
#if !os(tvOS)
#if !tvOS
static var enabledCases: [DashboardPage] = [
.overview,
.groups,
Expand Down
8 changes: 4 additions & 4 deletions sing-box.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2734,7 +2734,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.9.4;
MARKETING_VERSION = "1.10.0-alpha.18";
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfavt.system;
PRODUCT_NAME = "$(inherited)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2770,7 +2770,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.9.4;
MARKETING_VERSION = "1.10.0-alpha.18";
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfavt.system;
PRODUCT_NAME = "$(inherited)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2812,7 +2812,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.9.4;
MARKETING_VERSION = "1.10.0-alpha.18";
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfavt.standalone;
PRODUCT_NAME = SFM;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2853,7 +2853,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.9.4;
MARKETING_VERSION = "1.10.0-alpha.18";
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfavt.standalone;
PRODUCT_NAME = SFM;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down

0 comments on commit 10481fe

Please sign in to comment.