Closed ShlomoCode closed 4 days ago
Hey, thank you. I added in your message and just extended the alert function so it's cleaner. Will be in next version:)
I think people will not pay attention to the information when the title is "Restart required"
Fixed
It now displays: But clicking "Cancel" has no effect. Why don't we improve the code so that no restart is needed at all? I can try to make a PR
Something like that:
Toggle(isOn: $showMenuBarIcon, label: {
Text("Show Menu Bar Icon")
})
.onChange(of: showMenuBarIcon) { _, isOn in
let delegate = NSApplication.shared.delegate as! AppDelegate
delegate.updateMenuBarIconStatus()
if !isOn {
MessageUtil.showMessage(
showCancelButton: false,
title: "Menu Bar Icon Hidden",
message: "If you need to access the menu bar icon, launch the app to reveal it for 10 seconds.",
completion: { _ in }
)
}
}