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

Rich content in menu bar #630

Closed
matryer opened this issue Mar 13, 2021 · 14 comments
Closed

Rich content in menu bar #630

matryer opened this issue Mar 13, 2021 · 14 comments
Labels

Comments

@matryer
Copy link
Owner

matryer commented Mar 13, 2021

The Tray menu (the item that sits in the menu bar) does not support rich content (fonts, colours, etc.) unlike the menu items in the dropdown.

@leaanthony What's involved in getting this added to Wails?

@leaanthony
Copy link
Collaborator

It'll be a bit of a refactor but it shouldn't be impossible 😃

@omeraloni
Copy link

On the same note, BitBar supported Nerd Fonts, which allowed using custom icons:
image
image

In xBar, those fonts show up like this:
image

@matryer
Copy link
Owner Author

matryer commented Mar 15, 2021

Thanks @omeraloni - you're right, I think that is related, don't you @leaanthony?

@leaanthony
Copy link
Collaborator

I would think so, assuming you need to install nerd fonts on your system to make it work.

@omeraloni
Copy link

@leaanthony yep, you need to install them to make it work

@matryer
Copy link
Owner Author

matryer commented Mar 18, 2021

@omeraloni we think this is fixed in the latest release, can you test it and let me know?

@furkantektas
Copy link

furkantektas commented Mar 18, 2021

@matryer It works, thank you. I didn't test custom fonts but specified font colour is now working on the last update.

@matryer
Copy link
Owner Author

matryer commented Mar 18, 2021

Thanks @furkantektas.

@matryer matryer closed this as completed Mar 18, 2021
@kazhala
Copy link

kazhala commented Mar 21, 2021

Hi @matryer,

Thanks for the huge update to bitbar. I just ported scripts from bitbar to xbar which does utilise nerd font and while the colour/font size is working fine, the nerd front is not being displayed properly.

OS: 10.15.4
xbar: v2.0.32-beta

print(" | size=27 font='DejaVuSansMono Nerd Font Mono'")
print("---")
for alarm in alarms:
    print("%s  %s" % (alarm["Name"], alarm["State"]))

Running the above script in both bitbar and xbar (left is bitbar and right is xbar):
Screen Shot 2021-03-21 at 1 12 00 pm

Seems like the custom font issue is still present, could we reopen this issue. Really appreciate all the work.

Thanks,
Kevin

@leaanthony
Copy link
Collaborator

Hi there. We are currently using the postscript name for the font discovery. So

DejaVuSansMonoNerdFontCompleteM-Book

works. That being said the icon is quite high up. Any ideas why this font might do that?
image

@kazhala
Copy link

kazhala commented Mar 21, 2021

Hi @leaanthony,

Thanks for the hint. The font is showing properly using the postscript location.

Regarding the weird placement, I'm not really sure. It's actually slightly lower on my system when the font size is bigger...mostly likely either mine is an older version of the font or maybe OS version difference?

The placement of the icon will also change when the font size increase/decrease. Not sure how this can be fixed unless there's a way to center the font?

@leaanthony
Copy link
Collaborator

leaanthony commented Mar 21, 2021

I'll have another look at it. On my system, it went higher the bigger it was. Almost like it only occupied the top half of the space allocated. I guess font icons will always be subject to local environmental differences, which is why images are the preceded solution.

@leaanthony
Copy link
Collaborator

leaanthony commented Mar 21, 2021

@kazhala - Just wanted to say thanks for bringing my attention to the font naming issue. I've made a change in Wails to allow the name to be more permissive and tried with your original script and it appears to be working as you originally expected:

echo " | size=26 font='DejaVuSansMono Nerd Font Mono'"
echo "---"

I've pushed a change for xbar so this will be included in the next release. Thanks for helping us improve 👍

EDIT: Just found this thread that may explain why the icon looks small for me: ryanoasis/nerd-fonts#127

@kazhala
Copy link

kazhala commented Mar 21, 2021

Hi @leaanthony, thank you for the hard work and quick action on the matter. Really appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants