Skip to content

Set system tray menu items to disabled at start up #2200

Answered by woubuc
tinomatic asked this question in Q&A
Discussion options

You must be logged in to vote

You can use .disabled() on your CustomMenuItem to set it to disabled right away, before you add it to the menu.

From my code:

SystemTray::new().with_menu(SystemTrayMenu::new()
    .add_item(CustomMenuItem::new("action".to_string(), "Loading...").disabled())
    .add_item(CustomMenuItem::new("quit".to_string(), "Quit"))
)

This results in a disabled menu item that says "Loading...":

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tinomatic
Comment options

Answer selected by amrbashir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants