Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change to use AppKit to show about window #802

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions Easydict/App/EasydictApp.swift
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Easydict/Swift/View/MenuView/MainMenuCommand.swift
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ struct EasydictMainMenu: Commands {
// Override About
CommandGroup(replacing: .appInfo) {
Button {
openWindow(id: .aboutWindowId)
HostWindowManager.shared.showAboutWindow()
} label: {
Text("menubar.about")
}
8 changes: 8 additions & 0 deletions Easydict/Swift/View/Window/HostWindowManager.swift
Original file line number Diff line number Diff line change
@@ -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()
}
}
}