mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Add shortcuts
This commit is contained in:
parent
a8556f3221
commit
078f117916
3 changed files with 155 additions and 0 deletions
|
@ -52,6 +52,7 @@ pub struct Config {
|
|||
pub uda_calendar_months_per_row: usize,
|
||||
pub uda_style_context_active: Style,
|
||||
pub uda_style_calendar_title: Style,
|
||||
pub uda_shortcuts: Vec<String>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
@ -76,6 +77,7 @@ impl Config {
|
|||
uda_calendar_months_per_row: Self::get_uda_months_per_row(),
|
||||
uda_style_calendar_title: Self::get_uda_style("calendar.title").unwrap_or_default(),
|
||||
uda_style_context_active: Self::get_uda_style("context.active").unwrap_or_default(),
|
||||
uda_shortcuts: Self::get_uda_shortcuts(),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -83,6 +85,16 @@ impl Config {
|
|||
HashMap::new()
|
||||
}
|
||||
|
||||
fn get_uda_shortcuts() -> Vec<String> {
|
||||
let mut v = vec![];
|
||||
for s in 0..9 {
|
||||
let c = format!("uda.taskwarrior-tui.shortcuts.{}", s);
|
||||
let s = Self::get_config(&c);
|
||||
v.push(s);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
fn get_uda_style(config: &str) -> Option<Style> {
|
||||
let c = format!("uda.taskwarrior-tui.style.{}", config);
|
||||
let s = Self::get_config(&c);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue