Skip to main content

par_term/menu/
actions.rs

1//! Menu action definitions for par-term
2//!
3//! This module defines the `MenuAction` enum that represents all possible
4//! menu actions that can be triggered from the native menu system.
5
6use crate::profile::ProfileId;
7
8/// Actions that can be triggered from the menu system
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub enum MenuAction {
11    // File menu
12    /// Create a new terminal window
13    NewWindow,
14    /// Close the current window
15    CloseWindow,
16    /// Quit the application (only used on Windows/Linux - macOS handles quit via system menu)
17    #[allow(dead_code)]
18    Quit,
19
20    // Profiles menu
21    /// Open the profile management modal
22    ManageProfiles,
23    /// Toggle the profile drawer visibility
24    ToggleProfileDrawer,
25    /// Open a specific profile (static menu entries for common profiles)
26    #[allow(dead_code)]
27    OpenProfile(ProfileId),
28
29    // Tab menu
30    /// Create a new tab
31    NewTab,
32    /// Close the current tab
33    CloseTab,
34    /// Switch to next tab
35    NextTab,
36    /// Switch to previous tab
37    PreviousTab,
38    /// Switch to tab by index (1-9)
39    SwitchToTab(usize),
40    /// Move tab left (not yet implemented)
41    #[allow(dead_code)]
42    MoveTabLeft,
43    /// Move tab right (not yet implemented)
44    #[allow(dead_code)]
45    MoveTabRight,
46    /// Duplicate the current tab (not yet implemented)
47    #[allow(dead_code)]
48    DuplicateTab,
49
50    // Edit menu
51    /// Copy selected text to clipboard
52    Copy,
53    /// Paste from clipboard
54    Paste,
55    /// Select all text (not typically used in terminals)
56    SelectAll,
57    /// Clear the scrollback buffer
58    ClearScrollback,
59    /// Show clipboard history panel
60    ClipboardHistory,
61
62    // View menu
63    /// Toggle fullscreen mode
64    ToggleFullscreen,
65    /// Maximize window vertically only (span full screen height)
66    MaximizeVertically,
67    /// Increase font size
68    IncreaseFontSize,
69    /// Decrease font size
70    DecreaseFontSize,
71    /// Reset font size to default
72    ResetFontSize,
73    /// Toggle FPS overlay
74    ToggleFpsOverlay,
75    /// Open settings panel
76    OpenSettings,
77
78    // Window menu (macOS)
79    /// Minimize the window
80    Minimize,
81    /// Zoom/maximize the window
82    Zoom,
83
84    // Help menu
85    /// Show keyboard shortcuts help
86    ShowHelp,
87    /// Show about dialog
88    About,
89
90    // Window Arrangements
91    /// Save the current window layout as an arrangement
92    SaveArrangement,
93
94    // Shell menu
95    /// Install shell integration on a remote host via curl
96    InstallShellIntegrationRemote,
97
98    // Keybinding actions (triggered by user-defined keybindings or menu)
99    /// Toggle background/custom shader on/off
100    #[allow(dead_code)]
101    ToggleBackgroundShader,
102    /// Toggle cursor shader on/off
103    #[allow(dead_code)]
104    ToggleCursorShader,
105    /// Reload configuration from disk (same as F5)
106    #[allow(dead_code)]
107    ReloadConfig,
108}