aboutsummaryrefslogtreecommitdiff
path: root/src/config/ui.rs
blob: b7b004e28d2e1b18f76d5282a512a252bc9021df (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// SPDX-License-Identifier: MIT
// Copyright (c) 2023 Robin Jarry

use std::collections::HashMap;

use derivative::Derivative;
use gtmpl::Template;

use crate::config::columns::ColumnDef;
use crate::config::style::StyleSet;

#[derive(Derivative)]
#[derivative(Debug, Default)]
pub struct UiConfig {
    // message list
    pub index_columns: Vec<ColumnDef>,
    pub column_separator: String,
    pub empty_message: String,
    pub threading_enabled: bool,
    pub force_client_threads: bool,
    pub client_threads_delay: time::Duration,
    pub sort: Vec<String>,
    pub reverse_order: bool,
    pub reverse_thread_order: bool,
    pub sort_thread_siblings: bool,

    // dirlist
    #[derivative(Debug(format_with = "crate::config::templates::debug_template"))]
    pub dirlist_left: Template,
    #[derivative(Debug(format_with = "crate::config::templates::debug_template"))]
    pub dirlist_right: Template,
    pub sidebar_width: u8,
    pub empty_dirlist: String,
    pub dirlist_delay: time::Duration,
    pub dirlist_tree: bool,
    pub dirlist_collapse: u8,

    // time formats
    pub timestamp_format: String,
    pub this_day_time_format: String,
    pub this_week_time_format: String,
    pub this_year_time_format: String,
    pub msgview_timestamp_format: String,
    pub msgview_this_day_time_format: String,
    pub msgview_this_week_time_format: String,
    pub msgview_this_year_time_format: String,

    // icons
    pub icon_unencrypted: String,
    pub icon_encrypted: String,
    pub icon_signed: String,
    pub icon_signed_encrypted: String,
    pub icon_unknown: String,
    pub icon_invalid: String,
    pub icon_attachment: String,

    // style
    pub stylesets_dirs: Vec<String>,
    pub styleset_name: String,
    style: StyleSet,

    // general appearance
    pub border_vertical: char,
    pub border_horizontal: char,
    pub spinner: String,
    pub spinner_delimiter: String,
    pub spinner_interval: time::Duration,
    pub pinned_tab_marker: String,

    // behaviour
    pub automark_read: bool,
    pub next_message_on_delete: bool,
    pub mouse_enabled: bool,
    pub fuzzy_complete: bool,
    pub new_message_bell: bool,
    pub completion_delay: time::Duration,
    pub completion_min_chars: u8,
    pub completion_popovers: bool,

    // tabs
    #[derivative(Debug(format_with = "crate::config::templates::debug_template"))]
    pub tab_title_account: Template,
    #[derivative(Debug(format_with = "crate::config::templates::debug_template"))]
    pub tab_title_composer: Template,

    // contextual
    contextual_sections: Vec<UiContext>,
    contextual_counts: HashMap<UiContextType, usize>,
    contextual_cache: HashMap<UiContextKey, UiConfig>,
}

#[derive(Debug)]
struct UiContext {}

#[derive(Debug)]
enum UiContextType {}

#[derive(Debug)]
struct UiContextKey {}