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:
Jens Krause
2025-04-30 11:11:33 +02:00
committed by GitHub
parent 90d9988e7a
commit e6291a3131
6 changed files with 117 additions and 60 deletions

View File

@@ -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,
)