mirror of
https://github.com/cranci1/Sora.git
synced 2026-05-12 21:10:46 +00:00
Stagemanager Support & Cache Wording inconsistency fixes (#135)
This commit is contained in:
parent
d26f066da0
commit
e0c6e03c3f
2 changed files with 17 additions and 5 deletions
|
|
@ -16,6 +16,7 @@ struct LibraryView: View {
|
||||||
@AppStorage("mediaColumnsLandscape") private var mediaColumnsLandscape: Int = 4
|
@AppStorage("mediaColumnsLandscape") private var mediaColumnsLandscape: Int = 4
|
||||||
|
|
||||||
@Environment(\.verticalSizeClass) var verticalSizeClass
|
@Environment(\.verticalSizeClass) var verticalSizeClass
|
||||||
|
@Environment(\.horizontalSizeClass) var horizontalSizeClass
|
||||||
|
|
||||||
@State private var selectedBookmark: LibraryItem? = nil
|
@State private var selectedBookmark: LibraryItem? = nil
|
||||||
@State private var isDetailActive: Bool = false
|
@State private var isDetailActive: Bool = false
|
||||||
|
|
@ -28,10 +29,15 @@ struct LibraryView: View {
|
||||||
]
|
]
|
||||||
|
|
||||||
private var columnsCount: Int {
|
private var columnsCount: Int {
|
||||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
// Stage Manager Detection
|
||||||
|
if UIDevice.current.userInterfaceIdiom == .pad && horizontalSizeClass == .compact {
|
||||||
|
return verticalSizeClass == .compact ? 3 : 2
|
||||||
|
} else if UIDevice.current.userInterfaceIdiom == .pad {
|
||||||
|
// Normal iPad layout
|
||||||
let isLandscape = UIScreen.main.bounds.width > UIScreen.main.bounds.height
|
let isLandscape = UIScreen.main.bounds.width > UIScreen.main.bounds.height
|
||||||
return isLandscape ? mediaColumnsLandscape : mediaColumnsPortrait
|
return isLandscape ? mediaColumnsLandscape : mediaColumnsPortrait
|
||||||
} else {
|
} else {
|
||||||
|
// iPhone layout
|
||||||
return verticalSizeClass == .compact ? mediaColumnsLandscape : mediaColumnsPortrait
|
return verticalSizeClass == .compact ? mediaColumnsLandscape : mediaColumnsPortrait
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -206,9 +212,15 @@ struct LibraryView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func determineColumns() -> Int {
|
private func determineColumns() -> Int {
|
||||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
// Stage Manager Detection
|
||||||
|
if UIDevice.current.userInterfaceIdiom == .pad && horizontalSizeClass == .compact {
|
||||||
|
return verticalSizeClass == .compact ? 3 : 2
|
||||||
|
} else if UIDevice.current.userInterfaceIdiom == .pad {
|
||||||
|
// Normal iPad layout
|
||||||
|
let isLandscape = UIScreen.main.bounds.width > UIScreen.main.bounds.height
|
||||||
return isLandscape ? mediaColumnsLandscape : mediaColumnsPortrait
|
return isLandscape ? mediaColumnsLandscape : mediaColumnsPortrait
|
||||||
} else {
|
} else {
|
||||||
|
// iPhone layout
|
||||||
return verticalSizeClass == .compact ? mediaColumnsLandscape : mediaColumnsPortrait
|
return verticalSizeClass == .compact ? mediaColumnsLandscape : mediaColumnsPortrait
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ struct SettingsViewData: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
Text("Current Cache Size")
|
Text("Current Metadata Cache Size")
|
||||||
Spacer()
|
Spacer()
|
||||||
if isCalculatingSize {
|
if isCalculatingSize {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
|
|
@ -73,7 +73,7 @@ struct SettingsViewData: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(action: clearAllCaches) {
|
Button(action: clearAllCaches) {
|
||||||
Text("Clear All Caches")
|
Text("Clear All Metadata Caches")
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -101,7 +101,7 @@ struct SettingsViewData: View {
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
showRemoveMovPkgAlert = true
|
showRemoveMovPkgAlert = true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue