Skip to content

Commit b51dc79

Browse files
committed
fix: pad
Signed-off-by: Lessica <82flex@gmail.com>
1 parent cb5b878 commit b51dc79

File tree

4 files changed

+46
-29
lines changed

4 files changed

+46
-29
lines changed

TrollFools/AppListView.swift

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import SwiftUIIntrospect
1313
typealias Scope = AppListModel.Scope
1414

1515
struct AppListView: View {
16+
let isPad: Bool = UIDevice.current.userInterfaceIdiom == .pad
17+
1618
@StateObject var searchViewModel = AppListSearchModel()
1719
@EnvironmentObject var appList: AppListModel
1820

@@ -92,6 +94,47 @@ struct AppListView: View {
9294
}
9395

9496
var content: some View {
97+
styledNavigationView
98+
.animation(.easeOut, value: appList.activeScopeApps.keys)
99+
.sheet(item: $selectorOpenedURL) { urlWrapper in
100+
AppListView()
101+
.environmentObject(AppListModel(selectorURL: urlWrapper.url))
102+
}
103+
.onOpenURL { url in
104+
let ext = url.pathExtension.lowercased()
105+
guard url.isFileURL,
106+
ext == "dylib" || ext == "deb"
107+
else {
108+
return
109+
}
110+
let urlIdent = URLIdentifiable(url: preprocessURL(url))
111+
if !isWarningHidden && ext == "deb" {
112+
temporaryOpenedURL = urlIdent
113+
isWarningPresented = true
114+
} else {
115+
selectorOpenedURL = urlIdent
116+
}
117+
}
118+
.onAppear {
119+
if Double.random(in: 0 ..< 1) < 0.1 {
120+
isAdvertisementHidden = false
121+
}
122+
}
123+
}
124+
125+
var styledNavigationView: some View {
126+
Group {
127+
if isPad {
128+
navigationView
129+
.navigationViewStyle(.automatic)
130+
} else {
131+
navigationView
132+
.navigationViewStyle(.stack)
133+
}
134+
}
135+
}
136+
137+
var navigationView: some View {
95138
NavigationView {
96139
ScrollViewReader { reader in
97140
ZStack {
@@ -110,32 +153,6 @@ struct AppListView: View {
110153
}
111154
}
112155
}
113-
.navigationViewStyle(StackNavigationViewStyle())
114-
.animation(.easeOut, value: appList.activeScopeApps.keys)
115-
.sheet(item: $selectorOpenedURL) { urlWrapper in
116-
AppListView()
117-
.environmentObject(AppListModel(selectorURL: urlWrapper.url))
118-
}
119-
.onOpenURL { url in
120-
let ext = url.pathExtension.lowercased()
121-
guard url.isFileURL,
122-
ext == "dylib" || ext == "deb"
123-
else {
124-
return
125-
}
126-
let urlIdent = URLIdentifiable(url: preprocessURL(url))
127-
if !isWarningHidden && ext == "deb" {
128-
temporaryOpenedURL = urlIdent
129-
isWarningPresented = true
130-
} else {
131-
selectorOpenedURL = urlIdent
132-
}
133-
}
134-
.onAppear {
135-
if Double.random(in: 0 ..< 1) < 0.1 {
136-
isAdvertisementHidden = false
137-
}
138-
}
139156
}
140157

141158
var refreshableListView: some View {

TrollFools/Version.Debug.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// https://help.apple.com/xcode/#/dev745c5c974
1010

1111
DEBUG_VERSION = 3.5
12-
DEBUG_BUILD_NUMBER = 202503141
12+
DEBUG_BUILD_NUMBER = 202503151

TrollFools/Version.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// https://help.apple.com/xcode/#/dev745c5c974
1010

1111
VERSION = 3.5
12-
BUILD_NUMBER = 37
12+
BUILD_NUMBER = 38

control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: wiki.qaq.trollfools
22
Name: TrollFools
3-
Version: 3.5-37
3+
Version: 3.5-38
44
Section: Applications
55
Depends: firmware (>= 14.0)
66
Architecture: iphoneos-arm

0 commit comments

Comments
 (0)