Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Dec 20, 2024
1 parent 17ec655 commit 0fc94cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tools/cabana/videowidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void VideoWidget::createPlaybackController() {
toolbar->setIconSize({icon_size, icon_size});

toolbar->addAction(utils::icon("rewind"), tr("Seek backward"), []() { can->seekTo(can->currentSec() - 1); });
play_action = toolbar->addAction(utils::icon("play"), tr("Play"), []() { can->pause(!can->isPaused()); });
play_toggle_action = toolbar->addAction(utils::icon("play"), tr("Play"), []() { can->pause(!can->isPaused()); });
toolbar->addAction(utils::icon("fast-forward"), tr("Seek forward"), []() { can->seekTo(can->currentSec() + 1); });

if (can->liveStreaming()) {
Expand All @@ -88,9 +88,9 @@ void VideoWidget::createPlaybackController() {
});
}

time_btn = toolbar->addAction("", this, [this]() {
time_display_action = toolbar->addAction("", this, [this]() {
settings.absolute_time = !settings.absolute_time;
time_btn->setToolTip(settings.absolute_time ? tr("Elapsed time") : tr("Absolute time"));
time_display_action->setToolTip(settings.absolute_time ? tr("Elapsed time") : tr("Absolute time"));
updateState();
});

Expand Down Expand Up @@ -215,16 +215,16 @@ void VideoWidget::updateState() {
if (camera_tab->count() == 0) { // No streams available
cam_widget->update(); // Manually refresh to show alert events
}
time_btn->setText(QString("%1 / %2").arg(formatTime(can->currentSec(), true),
time_display_action->setText(QString("%1 / %2").arg(formatTime(can->currentSec(), true),
formatTime(slider->maximum() / slider->factor)));
} else {
time_btn->setText(formatTime(can->currentSec(), true));
time_display_action->setText(formatTime(can->currentSec(), true));
}
}

void VideoWidget::updatePlayBtnState() {
play_action->setIcon(utils::icon(can->isPaused() ? "play" : "pause"));
play_action->setToolTip(can->isPaused() ? tr("Play") : tr("Pause"));
play_toggle_action->setIcon(utils::icon(can->isPaused() ? "play" : "pause"));
play_toggle_action->setToolTip(can->isPaused() ? tr("Play") : tr("Pause"));
}

// Slider
Expand Down
4 changes: 2 additions & 2 deletions tools/cabana/videowidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class VideoWidget : public QFrame {
void vipcAvailableStreamsUpdated(std::set<VisionStreamType> streams);

StreamCameraView *cam_widget;
QAction *time_btn = nullptr;
QAction *play_action = nullptr;
QAction *time_display_action = nullptr;
QAction *play_toggle_action = nullptr;
QToolButton *speed_btn = nullptr;
QAction *skip_to_end_action = nullptr;
Slider *slider = nullptr;
Expand Down

0 comments on commit 0fc94cc

Please sign in to comment.