summaryrefslogtreecommitdiffstats
path: root/src/interactive/app/app_state.rs
blob: 14164d27bc0c5c0f5659824f9ad19bb09e0bf977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use std::time::Duration;

use dua::{
    inodefilter::InodeFilter,
    traverse::{RunningTraversal, Tree, TreeIndex},
    Throttle, WalkResult,
};
use petgraph::Direction;

use super::{navigation::Navigation, EntryDataBundle, SortMode};

#[derive(Default, Copy, Clone, PartialEq)]
pub enum FocussedPane {
    #[default]
    Main,
    Help,
    Mark,
    Glob,
}

#[derive(Default)]
pub struct Cursor {
    pub show: bool,
    pub x: u16,
    pub y: u16,
}

#[derive(Default)]
pub struct AppState {
    pub navigation: Navigation,
    pub glob_navigation: Option<Navigation>,
    pub entries: Vec<EntryDataBundle>,
    pub sorting: SortMode,
    pub message: Option<String>,
    pub focussed: FocussedPane,
    pub is_scanning: bool,
    pub received_event: bool,
    pub running_traversal: Option<RunningTraversal>,
}

pub enum ProcessingResult {
    ExitRequested(WalkResult),
}