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

@@ -33,6 +33,8 @@ pub fn render_ui(
buffer_state: &BufferState,
theme: &Theme,
is_edit_mode: bool,
is_highlight_mode: bool,
highlight_anchor: Option<(usize, usize)>,
total_count: u64,
current_position: u64,
current_dir: &str,
@@ -91,7 +93,9 @@ pub fn render_ui(
theme,
register_state,
app_state,
register_state.current_field < 4
register_state.current_field < 4,
is_highlight_mode,
highlight_anchor,
);
} else if app_state.ui.show_login {
render_login(
@@ -100,7 +104,9 @@ pub fn render_ui(
theme,
login_state,
app_state,
login_state.current_field < 2
login_state.current_field < 2,
is_highlight_mode,
highlight_anchor,
);
} else if app_state.ui.show_admin {
crate::components::admin::admin_panel::render_admin_panel(
@@ -165,6 +171,8 @@ pub fn render_ui(
&values,
theme,
is_edit_mode,
is_highlight_mode,
highlight_anchor,
total_count,
current_position,
);

View File

@@ -91,6 +91,8 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
&buffer_state,
&theme,
is_edit_mode,
event_handler.is_highlight_mode,
event_handler.highlight_anchor,
app_state.total_count,
app_state.current_position,
&app_state.current_dir,
@@ -108,6 +110,10 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
AppMode::Edit => {
terminal.show_cursor()?;
}
AppMode::Highlight => {
terminal.set_cursor_style(SetCursorStyle::SteadyBlock)?;
terminal.show_cursor()?;
}
AppMode::ReadOnly => {
if !app_state.ui.focus_outside_canvas {
terminal.set_cursor_style(SetCursorStyle::SteadyBlock)?;