-
Notifications
You must be signed in to change notification settings - Fork 179
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
Is it possible to select the font for title? #30
Comments
It can de done by using NSAttributedString which let's you define strings with attributes such as font, background color, foreground color, underline, etc. To see all options check the docs. The MenuItem class rumps provides is a wrapper for AppKit's NSMenuItem which has a attributedTitle property, rumps does not provide a way to set it so you'll need to access MenuItem's _menuitem internal variable and use some PyObjC. Here's a sample:
|
Diego, thanks for the sample code! Super useful. |
How would one bold the font here? Or italicize? I grep'd NSFont in Terminal and can't find anything useful. |
Thanks for explaining Bold and Oblique, Cheerless Dreamer. I did notice (in regards to your EDIT) that NSColor appears different in dark mode if you don't specify the alpha (the opacity). By default, the alpha is set to 0.5 for the rumps module. Change the following:
to:
And now, when you go into Dark Mode, it is completely red. |
I just wrote a quick countdown timer app in rumps - awesome work, really was a cinch!
The one question I had is how easy/possible it might be to change the font (ideally to a monospaced font like Monaco)? Some menubar apps seem able to do it, but I don't know enough of the Menubar/Cocoa specifics to know if that's something that's super hacky or not.
The text was updated successfully, but these errors were encountered: