mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
feat: Add current selection reverse highlight
This commit is contained in:
parent
79f18b1297
commit
1df457b6bf
3 changed files with 14 additions and 0 deletions
|
@ -12,6 +12,7 @@ uda.taskwarrior-tui.selection.bold=yes
|
||||||
uda.taskwarrior-tui.selection.italic=no
|
uda.taskwarrior-tui.selection.italic=no
|
||||||
uda.taskwarrior-tui.selection.dim=no
|
uda.taskwarrior-tui.selection.dim=no
|
||||||
uda.taskwarrior-tui.selection.blink=no
|
uda.taskwarrior-tui.selection.blink=no
|
||||||
|
uda.taskwarrior-tui.selection.reverse=no
|
||||||
uda.taskwarrior-tui.mark.indicator=✔
|
uda.taskwarrior-tui.mark.indicator=✔
|
||||||
uda.taskwarrior-tui.unmark.indicator=
|
uda.taskwarrior-tui.unmark.indicator=
|
||||||
uda.taskwarrior-tui.mark-selection.indicator=⦿
|
uda.taskwarrior-tui.mark-selection.indicator=⦿
|
||||||
|
|
|
@ -1173,6 +1173,9 @@ impl TaskwarriorTui {
|
||||||
if self.config.uda_selection_blink {
|
if self.config.uda_selection_blink {
|
||||||
highlight_style = highlight_style.add_modifier(Modifier::SLOW_BLINK);
|
highlight_style = highlight_style.add_modifier(Modifier::SLOW_BLINK);
|
||||||
}
|
}
|
||||||
|
if self.config.uda_selection_reverse {
|
||||||
|
highlight_style = highlight_style.add_modifier(Modifier::REVERSED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rows.push(Row::StyledData(task.iter(), style));
|
rows.push(Row::StyledData(task.iter(), style));
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ pub struct Config {
|
||||||
pub uda_selection_italic: bool,
|
pub uda_selection_italic: bool,
|
||||||
pub uda_selection_dim: bool,
|
pub uda_selection_dim: bool,
|
||||||
pub uda_selection_blink: bool,
|
pub uda_selection_blink: bool,
|
||||||
|
pub uda_selection_reverse: bool,
|
||||||
pub uda_calendar_months_per_row: usize,
|
pub uda_calendar_months_per_row: usize,
|
||||||
pub uda_style_context_active: Style,
|
pub uda_style_context_active: Style,
|
||||||
pub uda_report_style_selection: Style,
|
pub uda_report_style_selection: Style,
|
||||||
|
@ -99,6 +100,7 @@ impl Config {
|
||||||
let uda_selection_italic = Self::get_uda_selection_italic(data);
|
let uda_selection_italic = Self::get_uda_selection_italic(data);
|
||||||
let uda_selection_dim = Self::get_uda_selection_dim(data);
|
let uda_selection_dim = Self::get_uda_selection_dim(data);
|
||||||
let uda_selection_blink = Self::get_uda_selection_blink(data);
|
let uda_selection_blink = Self::get_uda_selection_blink(data);
|
||||||
|
let uda_selection_reverse = Self::get_uda_selection_reverse(data);
|
||||||
let uda_calendar_months_per_row = Self::get_uda_months_per_row(data);
|
let uda_calendar_months_per_row = Self::get_uda_months_per_row(data);
|
||||||
let uda_report_style_selection = Self::get_uda_style("report.selection", data);
|
let uda_report_style_selection = Self::get_uda_style("report.selection", data);
|
||||||
let uda_style_calendar_title = Self::get_uda_style("calendar.title", data);
|
let uda_style_calendar_title = Self::get_uda_style("calendar.title", data);
|
||||||
|
@ -142,6 +144,7 @@ impl Config {
|
||||||
uda_selection_italic,
|
uda_selection_italic,
|
||||||
uda_selection_dim,
|
uda_selection_dim,
|
||||||
uda_selection_blink,
|
uda_selection_blink,
|
||||||
|
uda_selection_reverse,
|
||||||
uda_calendar_months_per_row,
|
uda_calendar_months_per_row,
|
||||||
uda_report_style_selection,
|
uda_report_style_selection,
|
||||||
uda_style_context_active,
|
uda_style_context_active,
|
||||||
|
@ -545,6 +548,13 @@ impl Config {
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_uda_selection_reverse(data: &str) -> bool {
|
||||||
|
Self::get_config("uda.taskwarrior-tui.selection.reverse", data)
|
||||||
|
.unwrap_or_default()
|
||||||
|
.get_bool()
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
fn get_uda_months_per_row(data: &str) -> usize {
|
fn get_uda_months_per_row(data: &str) -> usize {
|
||||||
Self::get_config("uda.taskwarrior-tui.calendar.months-per-row", data)
|
Self::get_config("uda.taskwarrior-tui.calendar.months-per-row", data)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue