settings.rs

 1#[derive(Default, Clone, Copy)]
 2pub enum RowRenderMechanism {
 3    /// Default behaviour
 4    #[default]
 5    VariableList,
 6    /// More performance oriented, but all rows are same height
 7    #[allow(dead_code)] // Will be used when settings ui is added
 8    UniformList,
 9}
10
11#[derive(Default, Clone, Copy)]
12pub enum VerticalAlignment {
13    /// Align text to the top of cells
14    #[default]
15    Top,
16    /// Center text vertically in cells
17    Center,
18}
19
20#[derive(Default, Clone, Copy)]
21pub enum FontType {
22    /// Use the default UI font
23    #[default]
24    Ui,
25    /// Use monospace font (same as buffer/editor font)
26    Monospace,
27}
28
29#[derive(Default, Clone, Copy)]
30pub enum RowIdentifiers {
31    /// Show original line numbers from CSV file
32    #[default]
33    SrcLines,
34    /// Show sequential row numbers starting from 1
35    RowNum,
36}
37
38#[derive(Clone, Default)]
39pub(crate) struct CsvPreviewSettings {
40    pub(crate) rendering_with: RowRenderMechanism,
41    pub(crate) vertical_alignment: VerticalAlignment,
42    pub(crate) font_type: FontType,
43    pub(crate) numbering_type: RowIdentifiers,
44    pub(crate) show_debug_info: bool,
45    pub(crate) multiline_cells_enabled: bool,
46}