mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Make mark and unmark indicators configurable
This commit is contained in:
parent
34f6dcca34
commit
93b9807fbe
3 changed files with 42 additions and 1 deletions
|
@ -45,6 +45,8 @@ pub struct Config {
|
|||
pub uda_task_report_show_info: bool,
|
||||
pub uda_task_report_looping: bool,
|
||||
pub uda_selection_indicator: String,
|
||||
pub uda_mark_indicator: String,
|
||||
pub uda_unmark_indicator: String,
|
||||
pub uda_selection_bold: bool,
|
||||
pub uda_selection_italic: bool,
|
||||
pub uda_selection_dim: bool,
|
||||
|
@ -70,6 +72,8 @@ impl Config {
|
|||
uda_task_report_show_info: Self::get_uda_task_report_show_info(),
|
||||
uda_task_report_looping: Self::get_uda_task_report_looping(),
|
||||
uda_selection_indicator: Self::get_uda_selection_indicator(),
|
||||
uda_mark_indicator: Self::get_uda_mark_indicator(),
|
||||
uda_unmark_indicator: Self::get_uda_unmark_indicator(),
|
||||
uda_selection_bold: Self::get_uda_selection_bold(),
|
||||
uda_selection_italic: Self::get_uda_selection_italic(),
|
||||
uda_selection_dim: Self::get_uda_selection_dim(),
|
||||
|
@ -335,6 +339,24 @@ impl Config {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_uda_mark_indicator() -> String {
|
||||
let indicator = Self::get_config("uda.taskwarrior-tui.mark.indicator");
|
||||
if indicator.is_empty() {
|
||||
"☑ ".to_string()
|
||||
} else {
|
||||
format!("{} ", indicator)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uda_unmark_indicator() -> String {
|
||||
let indicator = Self::get_config("uda.taskwarrior-tui.unmark.indicator");
|
||||
if indicator.is_empty() {
|
||||
"☐ ".to_string()
|
||||
} else {
|
||||
format!("{} ", indicator)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uda_selection_bold() -> bool {
|
||||
Self::get_config("uda.taskwarrior-tui.selection.bold")
|
||||
.get_bool()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue