diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index ba5f15fcd..fb2983948 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -65,6 +65,12 @@ void HomeWindow::updateState(const UIState &s) { body->setEnabled(true); slayout->setCurrentWidget(body); } + + if (s.scene.started) { + if (s.scene.map_open) { + showSidebar(false); + } + } } void HomeWindow::offroadTransition(bool offroad) { @@ -73,6 +79,7 @@ void HomeWindow::offroadTransition(bool offroad) { if (offroad) { slayout->setCurrentWidget(home); } else { + showSidebar(params.getBool("Sidebar")); slayout->setCurrentWidget(onroad); } } @@ -82,7 +89,13 @@ void HomeWindow::showDriverView(bool show) { emit closeSettings(); slayout->setCurrentWidget(driver_view); } else { - slayout->setCurrentWidget(home); + if (started) { + slayout->setCurrentWidget(onroad); + sidebar->setVisible(params.getBool("Sidebar")); + } else { + slayout->setCurrentWidget(home); + sidebar->setVisible(show == false); + } } sidebar->setVisible(show == false); } @@ -91,6 +104,7 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) { // Handle sidebar collapsing if ((onroad->isVisible() || body->isVisible()) && (!sidebar->isVisible() || e->x() > sidebar->width())) { sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible()); + params.putBool("Sidebar", sidebar->isVisible()); } } diff --git a/selfdrive/ui/qt/window.cc b/selfdrive/ui/qt/window.cc index 74fd05ed7..985021a5f 100644 --- a/selfdrive/ui/qt/window.cc +++ b/selfdrive/ui/qt/window.cc @@ -74,10 +74,11 @@ void MainWindow::closeSettings() { main_layout->setCurrentWidget(homeWindow); if (uiState()->scene.started) { - homeWindow->showSidebar(false); // Map is always shown when using navigate on openpilot if (uiState()->scene.navigate_on_openpilot) { homeWindow->showMapPanel(true); + } else { + homeWindow->showSidebar(params.getBool("Sidebar")); } } }