From 4ec81ccfbf4bf9230dc87e1f05f1831f8681ac51 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Fri, 11 Dec 2020 16:16:43 -0500 Subject: [PATCH 1/2] Add help tooltips to the toolbar buttons. --- Shared/Navigation/ContentView.swift | 2 ++ macOS/Navigation/ActivePostToolbarView.swift | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index d5c1e4d..cf964fb 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -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() diff --git a/macOS/Navigation/ActivePostToolbarView.swift b/macOS/Navigation/ActivePostToolbarView.swift index 68b9d93..2d16c41 100644 --- a/macOS/Navigation/ActivePostToolbarView.swift +++ b/macOS/Navigation/ActivePostToolbarView.swift @@ -10,8 +10,10 @@ struct ActivePostToolbarView: View { HStack(spacing: 4) { Button(action: {}, label: { Image(systemName: "square.and.arrow.up") }) .disabled(activePost.status == PostStatus.local.rawValue) + .help("Copy the post's URL to your Mac's pasteboard.") Button(action: { publishPost(activePost) }, label: { Image(systemName: "paperplane") }) .disabled(activePost.body.isEmpty || activePost.status == PostStatus.published.rawValue) + .help("Publish the post to the web. You must be logged in to do this.") } } } From 554ca83014ff7873b23bd253e753b2def511d187 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Fri, 18 Dec 2020 10:23:52 -0500 Subject: [PATCH 2/2] Only show logged-in requirement if logged out --- macOS/Navigation/ActivePostToolbarView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macOS/Navigation/ActivePostToolbarView.swift b/macOS/Navigation/ActivePostToolbarView.swift index 2d16c41..22b02d6 100644 --- a/macOS/Navigation/ActivePostToolbarView.swift +++ b/macOS/Navigation/ActivePostToolbarView.swift @@ -13,7 +13,7 @@ struct ActivePostToolbarView: View { .help("Copy the post's URL to your Mac's pasteboard.") Button(action: { publishPost(activePost) }, label: { Image(systemName: "paperplane") }) .disabled(activePost.body.isEmpty || activePost.status == PostStatus.published.rawValue) - .help("Publish the post to the web. You must be logged in to do this.") + .help("Publish the post to the web.\(model.account.isLoggedIn ? "" : "You must be logged in to do this.")") // swiftlint:disable:this line_length } } }