-
Notifications
You must be signed in to change notification settings - Fork 29
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
Show images/icons in system tray menu items #30
Comments
without more at https://stackoverflow.com/questions/48452717/how-to-replace-the-deprecated-gtk3-gtkimagemenuitem |
But I haven't tried GTK4. Maybe that looks worse. |
For what it's worth my box is Debian stable (11/bullseye). And:
|
by adding a custom css to the menu item and using let box_container = gtk::Box::new(Orientation::Horizontal, 6);
let style_context = box_container.style_context();
let css_provider = gtk::CssProvider::new();
let theme = r#"
box {
margin-left: -22px;
}
"#;
let _ = css_provider.load_from_data(theme.as_bytes()); |
Looks good, but the pixel value probably won't work for all environments... I also wonder what makes my image appear on the right side 👀 |
I don't know how many CSS features are available. Maybe you can do a |
yeah, but it is a start, I will look into it again later if someone reports it. |
This issue is cross-posted from tauri-apps/tao#645
Linux
GTK menu items can be passed a box as a child instead of labels:
ImageMenuItem
is deprecated: https://docs.gtk.org/gtk3/class.ImageMenuItem.htmlMacOS
Not sure how it would be implemented but going by MeetingBar, it's possible: https://github.com/leits/MeetingBar
The text was updated successfully, but these errors were encountered: