summaryrefslogtreecommitdiffstats
path: root/src/app/panel_purpose.rs
blob: 3632078e7748d7b286f80147dd2aef60445bdf49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use {
    super::SelectionType,
};

/// the possible special reason the panel was open
#[derive(Debug, Clone, Copy)]
pub enum PanelPurpose {
    None,
    ArgEdition {
        arg_type: SelectionType,
    },
    Preview,
}

impl PanelPurpose {
    pub fn is_arg_edition(self) -> bool {
        matches!(self, PanelPurpose::ArgEdition { .. })
    }
    pub fn is_preview(self) -> bool {
        matches!(self, PanelPurpose::Preview)
    }
}