Update keybindings (#76)
* (pomodoro) reset both clocks at once * quit app by pressing `q` only * (countdown) enter/esc keybindings * (timer) enter/esc keybindings * (pomodoro) enter/esc keybindings * update footer label * fix(coundown): don't reset elapsed clock while skipping editing changes * fix(clock): order of actions matters for ESC handling. Set `pause` instead of `initial` mode while toggeling back. * fix(timer): order of actions matters (ESC key) * (footer) update order, lowercase standard keys
This commit is contained in:
@@ -104,7 +104,7 @@ impl StatefulWidget for Footer {
|
||||
let widths = [Constraint::Length(12), Constraint::Percentage(100)];
|
||||
let table = Table::new(
|
||||
[
|
||||
// content
|
||||
// screens
|
||||
Row::new(vec![
|
||||
Cell::from(Span::styled(
|
||||
"screens",
|
||||
@@ -112,27 +112,7 @@ impl StatefulWidget for Footer {
|
||||
)),
|
||||
Cell::from(Line::from(content_labels)),
|
||||
]),
|
||||
// format
|
||||
Row::new(vec![
|
||||
Cell::from(Span::styled(
|
||||
"appearance",
|
||||
Style::default().add_modifier(Modifier::BOLD),
|
||||
)),
|
||||
Cell::from(Line::from(vec![
|
||||
Span::from("[,]change style"),
|
||||
Span::from(SPACE),
|
||||
Span::from("[.]toggle deciseconds"),
|
||||
Span::from(SPACE),
|
||||
Span::from(format!(
|
||||
"[:]toggle {} time",
|
||||
match self.app_time {
|
||||
AppTime::Local(_) => "local",
|
||||
AppTime::Utc(_) => "utc",
|
||||
}
|
||||
)),
|
||||
])),
|
||||
]),
|
||||
// edit
|
||||
// controls
|
||||
Row::new(vec![
|
||||
Cell::from(Span::styled(
|
||||
"controls",
|
||||
@@ -170,12 +150,10 @@ impl StatefulWidget for Footer {
|
||||
}
|
||||
spans
|
||||
}
|
||||
others => vec![
|
||||
Span::from(match others {
|
||||
AppEditMode::Clock => "[e]dit done",
|
||||
AppEditMode::Time => "[^e]dit done",
|
||||
_ => "",
|
||||
}),
|
||||
_ => vec![
|
||||
Span::from("[enter]apply changes"),
|
||||
Span::from(SPACE),
|
||||
Span::from("[esc]skip changes"),
|
||||
Span::from(SPACE),
|
||||
Span::from(format!(
|
||||
"[{} {}]edit selection",
|
||||
@@ -190,6 +168,26 @@ impl StatefulWidget for Footer {
|
||||
}
|
||||
})),
|
||||
]),
|
||||
// appearance
|
||||
Row::new(vec![
|
||||
Cell::from(Span::styled(
|
||||
"appearance",
|
||||
Style::default().add_modifier(Modifier::BOLD),
|
||||
)),
|
||||
Cell::from(Line::from(vec![
|
||||
Span::from("[,]change style"),
|
||||
Span::from(SPACE),
|
||||
Span::from("[.]toggle deciseconds"),
|
||||
Span::from(SPACE),
|
||||
Span::from(format!(
|
||||
"[:]toggle {} time",
|
||||
match self.app_time {
|
||||
AppTime::Local(_) => "local",
|
||||
AppTime::Utc(_) => "utc",
|
||||
}
|
||||
)),
|
||||
])),
|
||||
]),
|
||||
],
|
||||
widths,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user