From ad05648f95f12000ac8855557d3d06117ad5452a Mon Sep 17 00:00:00 2001 From: Takumi Muraishi Date: Sun, 19 May 2024 20:10:56 +0900 Subject: [PATCH] [feat] add github documents --- .../QuickKeyAssistantApp/MenuView.swift | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/QuickKeyAssistantApp/QuickKeyAssistantApp/MenuView.swift b/QuickKeyAssistantApp/QuickKeyAssistantApp/MenuView.swift index 4113806..cc8d2b8 100644 --- a/QuickKeyAssistantApp/QuickKeyAssistantApp/MenuView.swift +++ b/QuickKeyAssistantApp/QuickKeyAssistantApp/MenuView.swift @@ -8,7 +8,8 @@ import SwiftUI struct MenuView: View { - @State private var isHovered = false + @State private var isHoveredGitHub = false + @State private var isHoveredSlack = false var body: some View { ScrollView { @@ -170,6 +171,21 @@ struct MenuView: View { .foregroundStyle(.gray) } + ZStack(alignment: .leading) { + if isHoveredGitHub { + Color.gray.opacity(0.3) + } + Text("Official Documents") + .onHover { hovered in + self.isHoveredGitHub = hovered + } + .onTapGesture { + if let url = URL(string: "https://docs.github.com/en/get-started/accessibility/keyboard-shortcuts") { + NSWorkspace.shared.open(url) + } + } + } + Divider() Text("Slack") @@ -185,12 +201,12 @@ struct MenuView: View { } ZStack(alignment: .leading) { - if isHovered { + if isHoveredSlack { Color.gray.opacity(0.3) } Text("Official Documents") .onHover { hovered in - self.isHovered = hovered + self.isHoveredSlack = hovered } .onTapGesture { if let url = URL(string: "https://slack.com/intl/en-gb/help/articles/201374536-Slack-keyboard-shortcuts-and-commands") {