Skip to main content

Module menu

Module menu 

Source
Expand description

Plugin menu system for the Scarab Dock

This module provides types for plugins to define contextual menus that appear in the Scarab Dock interface. Menu items can trigger commands, remote actions, or spawn submenus for hierarchical navigation.

§Example

use scarab_plugin_api::menu::{MenuItem, MenuAction};

// Create a simple command menu item
let item = MenuItem::new("Run Tests", MenuAction::Command("cargo test".to_string()))
    .with_icon("🧪")
    .with_shortcut("Ctrl+T");

// Create a submenu with multiple actions
let build_menu = MenuItem::new(
    "Build",
    MenuAction::SubMenu(vec![
        MenuItem::new("Debug", MenuAction::Command("cargo build".to_string())),
        MenuItem::new("Release", MenuAction::Command("cargo build --release".to_string())),
    ])
);

Structs§

MenuItem
A menu item that can be displayed in the Scarab Dock

Enums§

MenuAction
Action to perform when a menu item is selected