diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index 526eb5f2de..09eb4045b2 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -58,7 +58,7 @@ MapWindow::MapWindow(const QMapboxGLSettings &settings) : m_settings(settings), } )"); QObject::connect(settings_btn, &QPushButton::clicked, [=]() { - emit openSettings(); + emit requestSettings(true); }); overlay_layout->addWidget(map_instructions); @@ -157,6 +157,7 @@ void MapWindow::updateState(const UIState &s) { emit requestVisible(true); // Show map on destination set/change allow_open = false; } + emit requestSettings(false); } if (m_map.isNull()) { diff --git a/selfdrive/ui/qt/maps/map.h b/selfdrive/ui/qt/maps/map.h index ced618c1a1..2ef2d9aa9d 100644 --- a/selfdrive/ui/qt/maps/map.h +++ b/selfdrive/ui/qt/maps/map.h @@ -122,5 +122,5 @@ public slots: signals: void requestVisible(bool visible); - void openSettings(); + void requestSettings(bool settings); }; diff --git a/selfdrive/ui/qt/maps/map_panel.cc b/selfdrive/ui/qt/maps/map_panel.cc index 6bee7f0923..aeccaa71c1 100644 --- a/selfdrive/ui/qt/maps/map_panel.cc +++ b/selfdrive/ui/qt/maps/map_panel.cc @@ -19,8 +19,8 @@ MapPanel::MapPanel(const QMapboxGLSettings &mapboxSettings, QWidget *parent) : Q if (visible) { emit mapPanelRequested(); } setVisible(visible); }); - QObject::connect(map, &MapWindow::openSettings, [=]() { - content_stack->setCurrentIndex(1); + QObject::connect(map, &MapWindow::requestSettings, [=](bool settings) { + content_stack->setCurrentIndex(settings ? 1 : 0); }); content_stack->addWidget(map);