-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Monospace menubar #685
Monospace menubar #685
Conversation
Can we get a video demo? This seems pretty interesting |
Screen.Recording.2024-11-11.at.1.29.11.PM.movEmojis are pushed to the end, which is the same behavior that exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work, but I am not ready to accept such big PR. The PR is hardly reviewerable.
Please, fix problem by problem in small incremental accurate commits. The good first step is to only make the indicator monospaced and nothing else. Everything else can be discussed after that.
import Foundation | ||
import SwiftUI | ||
|
||
class AppDelegate: NSObject, NSApplicationDelegate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sources/AeroSpaceApp
should stay as small as possible, because this "module" is shared between Xcode and SPM. All the code must be pushed to Sources/AppBundle
module
// Add enable/disable item | ||
let enableItem = NSMenuItem( | ||
title: viewModel.isEnabled ? "Disable" : "Enable", action: #selector(toggleEnabled(_:)), keyEquivalent: "e") | ||
enableItem.target = self | ||
menu.addItem(enableItem) | ||
|
||
// Add open config item | ||
let editor = getTextEditorToOpenConfig() | ||
let openConfigItem = NSMenuItem( | ||
title: "Open config in '\(editor.lastPathComponent)'", action: #selector(openConfig(_:)), keyEquivalent: "o" | ||
) | ||
openConfigItem.target = self | ||
menu.addItem(openConfigItem) | ||
|
||
// Add reload config item if enabled | ||
if viewModel.isEnabled { | ||
let reloadConfigItem = NSMenuItem( | ||
title: "Reload config", action: #selector(reloadConfigAction(_:)), keyEquivalent: "r") | ||
reloadConfigItem.target = self | ||
menu.addItem(reloadConfigItem) | ||
} | ||
|
||
// Add quit item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid obvious comments
# Font size for menu bar | ||
font-size = 12.0 | ||
|
||
# Font family for the menu bar items | ||
# Use the Font Book to find fonts | ||
font-family = 'Andale Mono' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that font should be configurable. We should just pick a good default and stick with it.
Also see: #711 (comment) |
This PR addresses issue #56 by introducing three new options:
To accomplish this, I had to rewrite all menu bar items to use AppKit, as pure SwiftUI lacks the capability to display arbitrary views.
Here are some pictures demonstrating the feature in action: