Skip to main content

openlogi_core/binding/
category.rs

1//! Popover section categories for the action catalog.
2
3/// Grouping for popover section headers.
4///
5/// Used by [`Action::category`] and rendered as a small muted label above
6/// each group in the action picker.
7#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
8pub enum Category {
9    /// Cut, copy, paste, undo, redo, select-all, find, save.
10    Editing,
11    /// Browser navigation: tabs, page reload, back/forward.
12    Browser,
13    /// Playback and volume controls.
14    Media,
15    /// Physical mouse clicks.
16    Mouse,
17    /// DPI cycle and SmartShift.
18    Dpi,
19    /// Scroll direction shortcuts.
20    Scroll,
21    /// Window/app navigation: Mission Control, Launchpad, etc.
22    Navigation,
23    /// Lock screen, show desktop, system-level actions.
24    System,
25}
26
27impl Category {
28    /// Short label for popover section headers (already uppercase so callers
29    /// don't have to transform it).
30    #[must_use]
31    pub fn label(self) -> &'static str {
32        match self {
33            Category::Editing => "EDITING",
34            Category::Browser => "BROWSER",
35            Category::Media => "MEDIA",
36            Category::Mouse => "MOUSE",
37            Category::Dpi => "DPI",
38            Category::Scroll => "SCROLL",
39            Category::Navigation => "NAVIGATION",
40            Category::System => "SYSTEM",
41        }
42    }
43}