nav: hide settings on map request visible (#28884)

pull/28891/head
Cameron Clough 2 years ago committed by GitHub
parent 47ee0932db
commit 6643616c47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/ui/qt/maps/map.cc
  2. 2
      selfdrive/ui/qt/maps/map.h
  3. 4
      selfdrive/ui/qt/maps/map_panel.cc

@ -58,7 +58,7 @@ MapWindow::MapWindow(const QMapboxGLSettings &settings) : m_settings(settings),
} }
)"); )");
QObject::connect(settings_btn, &QPushButton::clicked, [=]() { QObject::connect(settings_btn, &QPushButton::clicked, [=]() {
emit openSettings(); emit requestSettings(true);
}); });
overlay_layout->addWidget(map_instructions); overlay_layout->addWidget(map_instructions);
@ -157,6 +157,7 @@ void MapWindow::updateState(const UIState &s) {
emit requestVisible(true); // Show map on destination set/change emit requestVisible(true); // Show map on destination set/change
allow_open = false; allow_open = false;
} }
emit requestSettings(false);
} }
if (m_map.isNull()) { if (m_map.isNull()) {

@ -122,5 +122,5 @@ public slots:
signals: signals:
void requestVisible(bool visible); void requestVisible(bool visible);
void openSettings(); void requestSettings(bool settings);
}; };

@ -19,8 +19,8 @@ MapPanel::MapPanel(const QMapboxGLSettings &mapboxSettings, QWidget *parent) : Q
if (visible) { emit mapPanelRequested(); } if (visible) { emit mapPanelRequested(); }
setVisible(visible); setVisible(visible);
}); });
QObject::connect(map, &MapWindow::openSettings, [=]() { QObject::connect(map, &MapWindow::requestSettings, [=](bool settings) {
content_stack->setCurrentIndex(1); content_stack->setCurrentIndex(settings ? 1 : 0);
}); });
content_stack->addWidget(map); content_stack->addWidget(map);

Loading…
Cancel
Save