From 2cf4cd67483c8cba7fda5e4124ad92f6b038a675 Mon Sep 17 00:00:00 2001 From: filipriec Date: Sun, 23 Mar 2025 22:08:33 +0100 Subject: [PATCH] appstate for form --- client/src/state/state.rs | 2 ++ client/src/ui/handlers/render.rs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/state/state.rs b/client/src/state/state.rs index eb74fd7..8645b6b 100644 --- a/client/src/state/state.rs +++ b/client/src/state/state.rs @@ -8,6 +8,7 @@ pub struct UiState { pub is_saved: bool, pub show_intro: bool, pub show_admin: bool, + pub show_form: bool, } pub struct GeneralState { @@ -64,6 +65,7 @@ impl Default for UiState { is_saved: false, show_intro: true, show_admin: false, + show_form: false, } } } diff --git a/client/src/ui/handlers/render.rs b/client/src/ui/handlers/render.rs index 2ce2100..58a95af 100644 --- a/client/src/ui/handlers/render.rs +++ b/client/src/ui/handlers/render.rs @@ -68,7 +68,7 @@ pub fn render_ui( &app_state.profile_tree, &app_state.selected_profile, ); - } else { + } else if app_state.ui.show_form { let (sidebar_area, form_area) = calculate_sidebar_layout( app_state.ui.show_sidebar, main_content_area @@ -80,7 +80,7 @@ pub fn render_ui( sidebar_rect, theme, &app_state.profile_tree, - &app_state.selected_profile // Remove trailing comma + &app_state.selected_profile ); } @@ -124,6 +124,8 @@ pub fn render_ui( total_count, current_position, ); + } else{ + } render_status_line(f, root[1], current_dir, theme, is_edit_mode);