Skip to content

Commit

Permalink
fix: change to use AppKit to show about window (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng authored Feb 3, 2025
1 parent 2a04958 commit fe248ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 0 additions & 9 deletions Easydict/App/EasydictApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ struct EasydictApp: App {
.environmentObject(languageState)
.environment(\.locale, .init(identifier: I18nHelper.shared.localizeCode))
}

// About window
Window("setting.about", id: .aboutWindowId) {
AboutTab()
.frame(width: 500, height: 220)
.disableWindowMinimize()
}
.windowResizability(.contentSize)
.windowStyle(.hiddenTitleBar)
}

// MARK: Private
Expand Down
2 changes: 1 addition & 1 deletion Easydict/Swift/View/MenuView/MainMenuCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct EasydictMainMenu: Commands {
// Override About
CommandGroup(replacing: .appInfo) {
Button {
openWindow(id: .aboutWindowId)
HostWindowManager.shared.showAboutWindow()
} label: {
Text("menubar.about")
}
Expand Down
8 changes: 8 additions & 0 deletions Easydict/Swift/View/Window/HostWindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,17 @@ final class HostWindowManager {
// MARK: - Window Creation Methods

extension HostWindowManager {
/// Show the acknowledgements window.
func showAcknowWindow() {
showWindow(windowId: .acknowledgementsWindowId) {
AcknowListView()
}
}

/// Show the About window.
func showAboutWindow() {
showWindow(windowId: .aboutWindowId, width: 500, height: 220, resizable: false) {
AboutTab()
}
}
}

0 comments on commit fe248ee

Please sign in to comment.