1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Popover section categories for the action catalog.
/// Grouping for popover section headers.
///
/// Used by [`Action::category`](crate::binding::Action::category) and rendered
/// as a small muted label above each group in the action picker.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Category {
/// Cut, copy, paste, undo, redo, select-all, find, save.
Editing,
/// Browser navigation: tabs, page reload, back/forward.
Browser,
/// Playback and volume controls.
Media,
/// Physical mouse clicks.
Mouse,
/// DPI cycle and SmartShift.
Dpi,
/// Scroll direction shortcuts.
Scroll,
/// Window/app navigation: Mission Control, Launchpad, etc.
Navigation,
/// Lock screen, show desktop, system-level actions.
System,
}
impl Category {
/// Human-readable English label for logs and non-localized contexts.
#[must_use]
pub fn label(self) -> &'static str {
match self {
Category::Editing => "Editing",
Category::Browser => "Browser",
Category::Media => "Media",
Category::Mouse => "Mouse",
Category::Dpi => "DPI",
Category::Scroll => "Scroll",
Category::Navigation => "Navigation",
Category::System => "System",
}
}
/// Stable catalog key for the localized popover section header.
#[must_use]
pub fn translation_key(self) -> &'static str {
match self {
Category::Editing => "actions.editing",
Category::Browser => "actions.browser",
Category::Media => "actions.media",
Category::Mouse => "device.mouse",
Category::Dpi => "pointer.dpi",
Category::Scroll => "pointer.scroll",
Category::Navigation => "actions.navigation",
Category::System => "actions.system",
}
}
}