mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-18 10:23:43 +08:00
ui: Hide Screenrecorder button when alert is displayed
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user