Skip to content

Commit

Permalink
FINALLY fixed scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Constantin Clerc committed Dec 21, 2023
1 parent c74be5f commit 2873de3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Geranium/GeraniumApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ struct GeraniumApp: App {
}
task.resume()
}
#if targetEnvironment(simulator)
#else
sendLog(RootHelper.loadMCM())
#endif
}
.sheet(isPresented: $isFirstRun) {
if #available(iOS 16.0, *) {
Expand Down
13 changes: 5 additions & 8 deletions Geranium/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ struct HomeView: View {
respring()
})
.padding()
Button("Reboot", action: {
killall("com.apple.launchd")
killall("launchd")
})
.padding()
Button("Rebuild Icon Cache", action: {
UIApplication.shared.alert(title:"Rebuilding Icon Cache...", body:"Please wait, your phone until your phone repsrings.", withButton: false)
let output = RootHelper.rebuildIconCache()
Expand All @@ -67,16 +62,18 @@ struct HomeView: View {
.ignoresSafeArea()
}
Text("")
List {
List() {
Section (header: Text("Credits")) {
LinkCell(imageLink: "https://cdn.discordapp.com/avatars/470637062870269952/67eb5d0a0501a96ab0a014ae89027e32.webp?size=160", url: "https://github.com/bomberfish", title: "BomberFish")
LinkCell(imageLink: "https://cdn.discordapp.com/avatars/396496265430695947/0904860dfb31d8b1f39f0e7dc4832b1e.webp?size=160", url: "https://github.com/donato-fiore", title: "fiore")
LinkCell(imageLink: "https://cdn.discordapp.com/avatars/412187004407775242/1df69ac879b9e5f98396553eeac80cec.webp?size=160", url: "https://github.com/sourcelocation", title: "sourcelocation")
LinkCell(imageLink: "https://avatars.githubusercontent.com/u/85764897?s=160&v=4", url: "https://github.com/haxi0", title: "haxi0")
}
}
// https://stackoverflow.com/a/75516471
.simultaneousGesture(DragGesture(minimumDistance: 0), including: .all)
.disableListScroll()
.onAppear {
UITableView.appearance().isScrollEnabled = false
}
}
}
.toolbar{
Expand Down
13 changes: 13 additions & 0 deletions Geranium/Libs/Addon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,16 @@ func SuccessfulOrWhat(_ inputBoolean: Bool) -> String {
return "Error"
}
}

// https://stackoverflow.com/a/76762126
extension View {
@ViewBuilder
func disableListScroll() -> some View {
if #available(iOS 16.0, *) {
self
.scrollDisabled(true)
} else {
self
.simultaneousGesture(DragGesture(minimumDistance: 0), including: .all)
}
}}

0 comments on commit 2873de3

Please sign in to comment.