#[non_exhaustive]pub enum IconRole {
Show 42 variants
DialogWarning,
DialogError,
DialogInfo,
DialogQuestion,
DialogSuccess,
Shield,
WindowClose,
WindowMinimize,
WindowMaximize,
WindowRestore,
ActionSave,
ActionDelete,
ActionCopy,
ActionPaste,
ActionCut,
ActionUndo,
ActionRedo,
ActionSearch,
ActionSettings,
ActionEdit,
ActionAdd,
ActionRemove,
ActionRefresh,
ActionPrint,
NavBack,
NavForward,
NavUp,
NavDown,
NavHome,
NavMenu,
FileGeneric,
FolderClosed,
FolderOpen,
TrashEmpty,
TrashFull,
StatusBusy,
StatusCheck,
StatusError,
UserAccount,
Notification,
Help,
Lock,
}Expand description
Semantic icon roles for cross-platform icon resolution.
Each variant represents a conceptual icon role (not a specific icon image).
Platform-specific icon identifiers are resolved via
icon_name() using an IconSet.
§Categories
Variants are grouped by prefix into 7 categories:
- Dialog (6): Alerts and dialog indicators
- Window (4): Window control buttons
- Action (14): Common user actions
- Navigation (6): Directional and structural navigation
- Files (5): File and folder representations
- Status (3): State indicators
- System (4): System-level UI elements
§Examples
use native_theme::theme::IconRole;
let role = IconRole::ActionSave;
match role {
IconRole::ActionSave => println!("save icon"),
_ => println!("other icon"),
}
// Iterate all roles
assert_eq!(IconRole::ALL.len(), 42);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DialogWarning
Warning indicator for dialogs
DialogError
Error indicator for dialogs
DialogInfo
Informational indicator for dialogs
DialogQuestion
Question indicator for dialogs
DialogSuccess
Success/confirmation indicator for dialogs
Shield
Security/shield indicator
WindowClose
Close window button
WindowMinimize
Minimize window button
WindowMaximize
Maximize window button
WindowRestore
Restore window button (from maximized state)
ActionSave
Save action
ActionDelete
Delete action
ActionCopy
Copy to clipboard
ActionPaste
Paste from clipboard
ActionCut
Cut to clipboard
ActionUndo
Undo last action
ActionRedo
Redo last undone action
ActionSearch
Search / find
ActionSettings
Settings / preferences
ActionEdit
Edit / modify
ActionAdd
Add / create new item
ActionRemove
Remove item
ActionRefresh
Refresh / reload
ActionPrint
Navigate backward
Navigate forward
Navigate up in hierarchy
Navigate down in hierarchy
Navigate to home / root
Open menu / hamburger
FileGeneric
Generic file icon
FolderClosed
Closed folder
FolderOpen
Open folder
TrashEmpty
Empty trash / recycle bin
TrashFull
Full trash / recycle bin
StatusBusy
Busy / working state indicator
StatusCheck
Check / success indicator
StatusError
Error state indicator
UserAccount
User account / profile
Notification
Notification / bell
Help
Help / question mark
Lock
Lock / security
Implementations§
Source§impl IconRole
impl IconRole
Sourcepub const ALL: [IconRole; 42]
pub const ALL: [IconRole; 42]
All icon role variants, useful for iteration and exhaustive testing.
Contains exactly 42 variants, one for each role, in declaration order.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The kebab-case string identifier for this icon role.
Returns a stable string suitable for logs, serialization, and
display. Category prefix and variant name are joined with hyphens
in lowercase (e.g., DialogWarning -> "dialog-warning").
§Examples
use native_theme::theme::IconRole;
assert_eq!(IconRole::ActionSave.name(), "action-save");
assert_eq!(IconRole::DialogWarning.name(), "dialog-warning");