diff --git a/Easydict/App/EasydictApp.swift b/Easydict/App/EasydictApp.swift index d1b33a5a6..140f6f003 100644 --- a/Easydict/App/EasydictApp.swift +++ b/Easydict/App/EasydictApp.swift @@ -67,15 +67,7 @@ struct EasydictApp: App { } .menuBarExtraStyle(.menu) .commands { - EasyDictMainMenu() // main menu - // Override About button - CommandGroup(replacing: .appInfo) { - Button { - openWindow(id: .aboutWindowId) - } label: { - Text("menubar.about") - } - } + EasydictMainMenu() // main menu } Settings { diff --git a/Easydict/Swift/View/MenuView/MainMenuCommand.swift b/Easydict/Swift/View/MenuView/MainMenuCommand.swift index 1330cf5b0..54a58b58b 100644 --- a/Easydict/Swift/View/MenuView/MainMenuCommand.swift +++ b/Easydict/Swift/View/MenuView/MainMenuCommand.swift @@ -8,22 +8,32 @@ import SwiftUI -struct EasyDictMainMenu: Commands { +struct EasydictMainMenu: Commands { // MARK: Internal var body: some Commands { - // shortcut + // Shortcuts MainMenuShortcutCommand() - // Help - CommandGroup(replacing: CommandGroupPlacement.help, addition: { + // Override Help + CommandGroup(replacing: .help) { Button("menu_feedback") { openURL(URL(string: "\(EZGithubRepoEasydictURL)/issues")!) } - }) + } + + // Override About + CommandGroup(replacing: .appInfo) { + Button { + openWindow(id: .aboutWindowId) + } label: { + Text("menubar.about") + } + } } // MARK: Private @Environment(\.openURL) private var openURL + @Environment(\.openWindow) private var openWindow } diff --git a/Easydict/Swift/View/MenuView/MainMenuShortcutCommand.swift b/Easydict/Swift/View/MenuView/MainMenuShortcutCommand.swift index e562eda82..280a49f6c 100644 --- a/Easydict/Swift/View/MenuView/MainMenuShortcutCommand.swift +++ b/Easydict/Swift/View/MenuView/MainMenuShortcutCommand.swift @@ -8,7 +8,7 @@ import SwiftUI -extension EasyDictMainMenu { +extension EasydictMainMenu { struct MainMenuShortcutCommand: Commands { // MARK: Internal