HIGHLIGHT MODE

This commit is contained in:
filipriec
2025-04-15 21:15:58 +02:00
parent f4689125e0
commit 2e9f8815d2
15 changed files with 225 additions and 30 deletions

View File

@@ -7,6 +7,7 @@ pub enum AppMode {
General, // For intro and admin screens
ReadOnly, // Canvas read-only mode
Edit, // Canvas edit mode
Highlight, // Cnavas highlight/visual mode
Command, // Command mode overlay
}
@@ -19,6 +20,10 @@ impl ModeManager {
return AppMode::Command;
}
if event_handler.is_highlight_mode {
return AppMode::Highlight;
}
if app_state.ui.focus_outside_canvas {
return AppMode::General;
}
@@ -50,6 +55,10 @@ impl ModeManager {
}
pub fn can_enter_read_only_mode(current_mode: AppMode) -> bool {
matches!(current_mode, AppMode::Edit | AppMode::Command)
matches!(current_mode, AppMode::Edit | AppMode::Command | AppMode::Highlight)
}
pub fn can_enter_highlight_mode(current_mode: AppMode) -> bool {
matches!(current_mode, AppMode::ReadOnly)
}
}