Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iced_context_menu

Customizable context menus for Iced 0.14: right-click or programmatic open, nested submenus, optional SVG row icons, hotkey hints, and theme-aware styling.

Nested context menus with icons, hotkeys, disabled row, and light theme

Usage

Add to Cargo.toml:

iced_context_menu = { git = "https://github.com/Fee0/iced_context_menu.git" }

Wrap any widget and supply a MenuSpec. Build with .action, .disabled, .separator, .submenu.

use iced::widget::text;
use iced_context_menu::{ContextMenu, ContextMenuStyle, MenuSpec};

fn view() -> iced::Element<'_, Message> {
    ContextMenu::new(text("Right-click me"))
        .items(
            MenuSpec::new()
                .action(1_u64, "Copy", None, Some("Ctrl+C".into()))
                .separator()
                .disabled(2_u64, "Unavailable", None, None),
        )
        .style(ContextMenuStyle::from_theme)
        .on_select(|id| Message::MenuItem(id))
        .into()
}

Open behavior defaults to right-click on the wrapped region. Programmatic open also supported.

Examples

Configure and test your context menu:

cargo run --example right_click

About

Context menus for Iced — overlays, submenus, icons, keyboard hints, and styling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages