From 1690cf4af6c88c52eeec0c61eae10074a169d563 Mon Sep 17 00:00:00 2001 From: mitchellgoffpc Date: Mon, 10 Jul 2023 13:52:55 -0700 Subject: [PATCH] Revert "UI: Indicate when Nav on OP is enabled (#28665)" This reverts commit a66135665c9256b4efa1c3ebac171b847dfdceaa. --- selfdrive/ui/qt/onroad.cc | 23 ++--------------------- selfdrive/ui/qt/onroad.h | 1 - 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 27d6d2c4e5..35fff4e0e6 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -64,20 +64,9 @@ void OnroadWindow::updateState(const UIState &s) { nvg->updateState(s); - // update spacing - bool navDisabledNow = (*s.sm)["controlsState"].getControlsState().getEnabled() && - !(*s.sm)["modelV2"].getModelV2().getNavEnabled(); - if (navDisabled != navDisabledNow) { - split->setSpacing(navDisabledNow ? UI_BORDER_SIZE * 2 : 0); - if (map) { - map->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE * (navDisabledNow ? 2 : 1)); - } - } - - // repaint border - if (bg != bgColor || navDisabled != navDisabledNow) { + if (bg != bgColor) { + // repaint border bg = bgColor; - navDisabled = navDisabledNow; update(); } } @@ -90,7 +79,6 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) { return; } map->setVisible(!sidebarVisible && !map->isVisible()); - update(); } #endif // propagation event to parent(HomeWindow) @@ -121,13 +109,6 @@ void OnroadWindow::offroadTransition(bool offroad) { void OnroadWindow::paintEvent(QPaintEvent *event) { QPainter p(this); p.fillRect(rect(), QColor(bg.red(), bg.green(), bg.blue(), 255)); - - if (isMapVisible() && navDisabled) { - QRect map_r = uiState()->scene.map_on_left - ? QRect(0, 0, width() / 2, height()) - : QRect(width() / 2, 0, width() / 2, height()); - p.fillRect(map_r, bg_colors[STATUS_DISENGAGED]); - } } // ***** onroad widgets ***** diff --git a/selfdrive/ui/qt/onroad.h b/selfdrive/ui/qt/onroad.h index c7e92fb9e2..e42f5f8cd8 100644 --- a/selfdrive/ui/qt/onroad.h +++ b/selfdrive/ui/qt/onroad.h @@ -129,7 +129,6 @@ private: QColor bg = bg_colors[STATUS_DISENGAGED]; QWidget *map = nullptr; QHBoxLayout* split; - bool navDisabled = false; private slots: void offroadTransition(bool offroad);