switched stuff in the state.rs

This commit is contained in:
filipriec
2025-03-21 22:46:50 +01:00
parent 44c5963c71
commit 1b0aaa55c9
5 changed files with 121 additions and 14 deletions

View File

@@ -5,15 +5,16 @@ use common::proto::multieko2::table_definition::ProfileTreeResponse;
pub struct UiState {
pub show_sidebar: bool,
pub profile_tree: ProfileTreeResponse,
pub is_saved: bool,
// pub show_intro: bool,
}
pub struct AppState {
// Core editor state
pub is_saved: bool,
pub current_dir: String,
pub total_count: u64,
pub current_position: u64,
pub profile_tree: ProfileTreeResponse,
// UI preferences
pub ui: UiState,
@@ -25,10 +26,10 @@ impl AppState {
.to_string_lossy()
.to_string();
Ok(AppState {
is_saved: false,
current_dir,
total_count: 0,
current_position: 0,
profile_tree: ProfileTreeResponse::default(),
ui: UiState::default(),
})
}
@@ -47,7 +48,7 @@ impl Default for UiState {
fn default() -> Self {
Self {
show_sidebar: true,
profile_tree: ProfileTreeResponse::default(),
is_saved: false,
}
}
}