FrogPilot features - Sidebar retains its previous display when going onroad

This commit is contained in:
FrogAi 2024-05-09 22:41:38 -07:00
parent db2c43a913
commit 08de67845d
2 changed files with 10 additions and 2 deletions

View File

@ -83,8 +83,14 @@ void HomeWindow::showDriverView(bool show) {
if (show) {
emit closeSettings();
slayout->setCurrentWidget(driver_view);
} else {
if (started) {
slayout->setCurrentWidget(onroad);
sidebar->setVisible(params.getBool("Sidebar"));
} else {
slayout->setCurrentWidget(home);
sidebar->setVisible(show == false);
}
}
sidebar->setVisible(show == false);
}
@ -94,6 +100,7 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
if ((onroad->isVisible() || body->isVisible()) && (!sidebar->isVisible() || e->x() > sidebar->width())) {
sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible());
uiState()->scene.map_open = onroad->isMapVisible();
params.putBool("Sidebar", sidebar->isVisible());
}
}

View File

@ -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"));
}
}
}