diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 2861a979d0..164abb7115 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -626,6 +626,11 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { // update onroad settings button state onroad_settings_btn->updateState(s); +#ifdef ENABLE_DASHCAM + // update screen recorder button + recorder->updateState(s); +#endif + // update buttons layout updateButtonsLayout(); @@ -648,6 +653,14 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { main_layout->setAlignment(onroad_settings_btn, (rightHandDM ? Qt::AlignRight : Qt::AlignLeft) | Qt::AlignBottom); } +#ifdef ENABLE_DASHCAM + // hide screen recorder button for alerts and flip for right hand DM + if (recorder->isEnabled()) { + recorder->setVisible(!hideBottomIcons); + main_layout->setAlignment(recorder, (rightHandDM ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignBottom); + } +#endif + const auto lp_sp = sm["longitudinalPlanSP"].getLongitudinalPlanSP(); slcState = lp_sp.getSpeedLimitControlState(); @@ -783,10 +796,6 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { e2eStatus = chime_prompt; e2eState = e2eLStatus; - -#ifdef ENABLE_DASHCAM - recorder->updateState(s); -#endif } void AnnotatedCameraWidget::drawHud(QPainter &p) { diff --git a/selfdrive/ui/qt/screenrecorder/screenrecorder.cc b/selfdrive/ui/qt/screenrecorder/screenrecorder.cc index f210af29a9..fa6ac96e20 100644 --- a/selfdrive/ui/qt/screenrecorder/screenrecorder.cc +++ b/selfdrive/ui/qt/screenrecorder/screenrecorder.cc @@ -28,6 +28,7 @@ ScreenRecoder::ScreenRecoder(QWidget *parent) : QPushButton(parent), image_queue rec_btn_size = 150; setVisible(false); + setEnabled(false); setFixedSize(rec_btn_size, rec_btn_size); setFocusPolicy(Qt::NoFocus); QObject::connect(this, &QPushButton::clicked, [=]() { @@ -183,4 +184,5 @@ void ScreenRecoder::update_screen() { void ScreenRecoder::updateState(const UIState &s) { bool show_toggle = params.getBool("ScreenRecorder") || recording; setVisible(show_toggle); + setEnabled(show_toggle); }