From fdb74ee8d9c5bc4b95aec5ac0e11b39d16219966 Mon Sep 17 00:00:00 2001 From: Matt Kiazyk Date: Mon, 28 Dec 2020 16:27:35 -0600 Subject: [PATCH] Adds the .help modifier to a variety of buttons --- Xcodes/Backend/XcodeCommands.swift | 6 ++++++ Xcodes/Frontend/XcodeList/InspectorPane.swift | 3 +++ Xcodes/Frontend/XcodeList/MainToolbar.swift | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Xcodes/Backend/XcodeCommands.swift b/Xcodes/Backend/XcodeCommands.swift index df00299..9045629 100644 --- a/Xcodes/Backend/XcodeCommands.swift +++ b/Xcodes/Backend/XcodeCommands.swift @@ -34,8 +34,10 @@ struct InstallButton: View { Button(action: uninstallOrInstall) { if let xcode = xcode { Text(xcode.installed == true ? "Uninstall" : "Install") + .help(xcode.installed == true ? "Uninstall" : "Install") } else { Text("Install") + .help("Install") } } } @@ -58,6 +60,7 @@ struct SelectButton: View { Button(action: select) { Text("Select") } + .help("Select") } private func select() { @@ -74,6 +77,7 @@ struct OpenButton: View { Button(action: open) { Text("Open") } + .help("Open") } private func open() { @@ -90,6 +94,7 @@ struct RevealButton: View { Button(action: reveal) { Text("Reveal in Finder") } + .help("Reveal in Finder") } private func reveal() { @@ -106,6 +111,7 @@ struct CopyPathButton: View { Button(action: copyPath) { Text("Copy Path") } + .help("Copy Path") } private func copyPath() { diff --git a/Xcodes/Frontend/XcodeList/InspectorPane.swift b/Xcodes/Frontend/XcodeList/InspectorPane.swift index 144d734..624e358 100644 --- a/Xcodes/Frontend/XcodeList/InspectorPane.swift +++ b/Xcodes/Frontend/XcodeList/InspectorPane.swift @@ -26,12 +26,14 @@ struct InspectorPane: View { Image(systemName: "arrow.right.circle.fill") } .buttonStyle(PlainButtonStyle()) + .help("Reveal in Finder") } HStack { if xcode.selected { Button("Selected", action: {}) .disabled(true) + .help("Selected") } else { SelectButton(xcode: xcode) } @@ -80,6 +82,7 @@ struct InspectorPane: View { } .buttonStyle(LinkButtonStyle()) .frame(maxWidth: .infinity, alignment: .leading) + .help("View Release Notes") } else { EmptyView() } diff --git a/Xcodes/Frontend/XcodeList/MainToolbar.swift b/Xcodes/Frontend/XcodeList/MainToolbar.swift index b34c88e..96afef9 100644 --- a/Xcodes/Frontend/XcodeList/MainToolbar.swift +++ b/Xcodes/Frontend/XcodeList/MainToolbar.swift @@ -20,6 +20,7 @@ struct MainToolbarModifier: ViewModifier { Label("Refresh", systemImage: "arrow.clockwise") } .keyboardShortcut(KeyEquivalent("r")) + .help("Refresh") Button(action: { switch category { @@ -35,7 +36,8 @@ struct MainToolbarModifier: ViewModifier { .foregroundColor(.accentColor) } } - + .help("Filter Installed Versions") + Button(action: { isShowingInfoPane.toggle() }) { if isShowingInfoPane { Label("Inspector", systemImage: "info.circle.fill") @@ -45,10 +47,12 @@ struct MainToolbarModifier: ViewModifier { } } .keyboardShortcut(KeyboardShortcut("i", modifiers: [.command, .option])) + .help("Info Pane") TextField("Search...", text: $searchText) .textFieldStyle(RoundedBorderTextFieldStyle()) .frame(width: 200) + .help("Search List") } } }