mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
PostList count should be text, not a button, in iOS bottom toolbar
This commit is contained in:
parent
275dd91e9c
commit
f646cf9eae
@ -7,47 +7,50 @@ struct PostList: View {
|
||||
|
||||
var body: some View {
|
||||
#if os(iOS)
|
||||
List {
|
||||
ForEach(showPosts(for: selectedCollection)) { post in
|
||||
NavigationLink(
|
||||
destination: PostEditor(post: post)
|
||||
) {
|
||||
PostCell(
|
||||
post: post
|
||||
)
|
||||
GeometryReader { geometry in
|
||||
List {
|
||||
ForEach(showPosts(for: selectedCollection)) { post in
|
||||
NavigationLink(
|
||||
destination: PostEditor(post: post)
|
||||
) {
|
||||
PostCell(
|
||||
post: post
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle(selectedCollection.title)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button(action: {
|
||||
let post = Post()
|
||||
postStore.add(post)
|
||||
}, label: {
|
||||
Image(systemName: "square.and.pencil")
|
||||
})
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Button(action: {
|
||||
isPresentingSettings = true
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
}).sheet(
|
||||
isPresented: $isPresentingSettings,
|
||||
onDismiss: {
|
||||
isPresentingSettings = false
|
||||
},
|
||||
content: {
|
||||
SettingsView(isPresented: $isPresentingSettings)
|
||||
.navigationTitle(selectedCollection.title)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button(action: {
|
||||
let post = Post()
|
||||
postStore.add(post)
|
||||
}, label: {
|
||||
Image(systemName: "square.and.pencil")
|
||||
})
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
HStack {
|
||||
Button(action: {
|
||||
isPresentingSettings = true
|
||||
}, label: {
|
||||
Image(systemName: "gear")
|
||||
}).sheet(
|
||||
isPresented: $isPresentingSettings,
|
||||
onDismiss: {
|
||||
isPresentingSettings = false
|
||||
},
|
||||
content: {
|
||||
SettingsView(isPresented: $isPresentingSettings)
|
||||
}
|
||||
)
|
||||
Spacer()
|
||||
Text(pluralizedPostCount(for: showPosts(for: selectedCollection)))
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
)
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Spacer()
|
||||
}
|
||||
ToolbarItem(placement: .bottomBar) {
|
||||
Text(pluralizedPostCount(for: showPosts(for: selectedCollection)))
|
||||
.padding()
|
||||
.frame(width: geometry.size.width)
|
||||
}
|
||||
}
|
||||
}
|
||||
#else //if os(macOS)
|
||||
|
@ -7,12 +7,12 @@
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
Loading…
Reference in New Issue
Block a user