mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 15:13:03 +00:00
press spacebar to reset selection
This commit is contained in:
parent
25e6644f30
commit
d5cd92ae3a
1 changed files with 9 additions and 0 deletions
|
@ -47,6 +47,7 @@ enum Command {
|
|||
UpdateStatus,
|
||||
TogglePause,
|
||||
Play,
|
||||
Reselect,
|
||||
Down,
|
||||
Up,
|
||||
JumpDown,
|
||||
|
@ -131,6 +132,9 @@ async fn run() -> Result<()> {
|
|||
KeyCode::Enter => {
|
||||
tx.send(Command::Play).await.unwrap_or_else(die);
|
||||
}
|
||||
KeyCode::Char(' ') => {
|
||||
tx.send(Command::Reselect).await.unwrap_or_else(die);
|
||||
}
|
||||
KeyCode::Char('j') | KeyCode::Down => {
|
||||
tx.send(Command::Down).await.unwrap_or_else(die);
|
||||
}
|
||||
|
@ -196,6 +200,11 @@ async fn run() -> Result<()> {
|
|||
}
|
||||
tx.send(Command::UpdateStatus).await?;
|
||||
}
|
||||
Command::Reselect => {
|
||||
selected = status.song.map_or(0, |song| song.pos);
|
||||
liststate.select(Some(selected));
|
||||
tx.send(Command::UpdateFrame).await?;
|
||||
}
|
||||
Command::Down => {
|
||||
let len = queue.len();
|
||||
if selected >= len {
|
||||
|
|
Loading…
Reference in a new issue