Skip to content

Commit

Permalink
fix some code nits
Browse files Browse the repository at this point in the history
  • Loading branch information
h3mosphere committed Apr 12, 2023
1 parent 31143ab commit aedfabf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions crates/re_ui/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ pub enum Command {

// Playback:
PlaybackTogglePlayPause,
PlaybackRestart,
PlaybackStepBack,
PlaybackStepForward,
PlaybackRestart,
}

impl Command {
Expand Down Expand Up @@ -117,7 +117,6 @@ impl Command {
Command::PlaybackTogglePlayPause => {
("Toggle play/pause", "Either play or pause the time")
}
Command::PlaybackRestart => ("Restart", "Restart from beginning of timeline"),
Command::PlaybackStepBack => (
"Step time back",
"Move the time marker back to the previous point in time with any data",
Expand All @@ -126,6 +125,7 @@ impl Command {
"Step time forward",
"Move the time marker to the next point in time with any data",
),
Command::PlaybackRestart => ("Restart", "Restart from beginning of timeline"),
}
}

Expand Down Expand Up @@ -183,9 +183,9 @@ impl Command {
Command::ToggleCommandPalette => Some(cmd(Key::P)),

Command::PlaybackTogglePlayPause => Some(key(Key::Space)),
Command::PlaybackRestart => Some(cmd(Key::ArrowLeft)),
Command::PlaybackStepBack => Some(key(Key::ArrowLeft)),
Command::PlaybackStepForward => Some(key(Key::ArrowRight)),
Command::PlaybackRestart => Some(cmd(Key::ArrowLeft)),
}
}

Expand Down
12 changes: 7 additions & 5 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const WATERMARK: bool = false; // Nice for recording media material
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
enum TimeControlCommand {
TogglePlayPause,
Restart,
StepBack,
StepForward,
Restart,
}

// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -337,7 +337,9 @@ impl App {
Command::PlaybackStepForward => {
self.run_time_control_command(TimeControlCommand::StepForward);
}
Command::PlaybackRestart => self.run_time_control_command(TimeControlCommand::Restart),
Command::PlaybackRestart => {
self.run_time_control_command(TimeControlCommand::Restart);
}
}
}

Expand All @@ -353,15 +355,15 @@ impl App {
TimeControlCommand::TogglePlayPause => {
time_ctrl.toggle_play_pause(times_per_timeline);
}
TimeControlCommand::Restart => {
time_ctrl.restart(times_per_timeline);
}
TimeControlCommand::StepBack => {
time_ctrl.step_time_back(times_per_timeline);
}
TimeControlCommand::StepForward => {
time_ctrl.step_time_fwd(times_per_timeline);
}
TimeControlCommand::Restart => {
time_ctrl.restart(times_per_timeline);
}
}
}

Expand Down

0 comments on commit aedfabf

Please sign in to comment.