Merge branch 'add-help-tooltips' into main

This commit is contained in:
Angelo Stavrow 2020-12-18 11:55:58 -05:00
commit f880b48021
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ struct ContentView: View {
},
label: { Image(systemName: "sidebar.left") }
)
.help("Toggle the sidebar's visibility.")
Spacer()
Button(action: {
withAnimation {
@ -45,6 +46,7 @@ struct ContentView: View {
}
}
}, label: { Image(systemName: "square.and.pencil") })
.help("Create a new local draft.")
}
#else
SidebarView()

View File

@ -66,6 +66,7 @@ struct ActivePostToolbarView: View {
Label("Publish…", systemImage: "paperplane")
})
.disabled(activePost.body.isEmpty)
.help("Publish the post to the web.\(model.account.isLoggedIn ? "" : " You must be logged in to do this.")") // swiftlint:disable:this line_length
} else {
HStack(spacing: 4) {
Button(
@ -75,6 +76,7 @@ struct ActivePostToolbarView: View {
label: { Image(systemName: "square.and.arrow.up") }
)
.disabled(activePost.status == PostStatus.local.rawValue)
.help("Copy the post's URL to your Mac's pasteboard.")
.popover(isPresented: $isPresentingSharingServicePicker) {
PostEditorSharingPicker(
isPresented: $isPresentingSharingServicePicker,
@ -84,6 +86,7 @@ struct ActivePostToolbarView: View {
}
Button(action: { publishPost(activePost) }, label: { Image(systemName: "paperplane") })
.disabled(activePost.body.isEmpty || activePost.status == PostStatus.published.rawValue)
.help("Publish the post to the web.\(model.account.isLoggedIn ? "" : " You must be logged in to do this.")") // swiftlint:disable:this line_length
}
}
}