Omit wrapping Section on Mac
This commit is contained in:
parent
cfc0d4f572
commit
171c1e1dd4
|
@ -125,7 +125,7 @@ struct OrganizerView: View {
|
|||
return ZStack {
|
||||
hiddenSceneView
|
||||
mainView
|
||||
if profileManager.headers.isEmpty {
|
||||
if !profileManager.hasProfiles {
|
||||
emptyView
|
||||
}
|
||||
}.toolbar {
|
||||
|
@ -171,19 +171,28 @@ struct OrganizerView: View {
|
|||
|
||||
private var mainView: some View {
|
||||
List {
|
||||
let headers = sortedHeaders
|
||||
if !headers.isEmpty {
|
||||
if profileManager.hasProfiles {
|
||||
switch themeIdiom {
|
||||
case .mac:
|
||||
profilesView
|
||||
|
||||
default:
|
||||
// FIXME: iPad multitasking, navigation binding does not clear on pop without Section
|
||||
Section {
|
||||
ForEach(sortedHeaders, content: profileRow(forHeader:))
|
||||
.onDelete(perform: removeProfiles)
|
||||
profilesView
|
||||
} header: {
|
||||
Text(L10n.Global.Strings.profiles)
|
||||
}
|
||||
}
|
||||
}
|
||||
}.themeAnimation(on: profileManager.headers)
|
||||
}
|
||||
|
||||
private var profilesView: some View {
|
||||
ForEach(sortedHeaders, content: profileRow(forHeader:))
|
||||
.onDelete(perform: removeProfiles)
|
||||
}
|
||||
|
||||
private var emptyView: some View {
|
||||
VStack {
|
||||
Text(L10n.Organizer.Empty.noProfiles)
|
||||
|
|
|
@ -109,6 +109,10 @@ extension ProfileManager {
|
|||
availableHeaders
|
||||
}
|
||||
|
||||
public var hasProfiles: Bool {
|
||||
!availableHeaders.isEmpty
|
||||
}
|
||||
|
||||
public var hasActiveProfile: Bool {
|
||||
activeHeader != nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue