this works but is ugly

pull/29068/head
Shane Smiskol 2 years ago
parent db7fb1f314
commit ad21fe0e2f
  1. 9
      selfdrive/ui/qt/maps/map_panel.cc
  2. 3
      selfdrive/ui/qt/maps/map_panel.h
  3. 3
      selfdrive/ui/qt/onroad.cc

@ -22,6 +22,7 @@ MapPanel::MapPanel(const QMapboxGLSettings &mapboxSettings, QWidget *parent) : Q
if (visible) { emit mapPanelRequested(); }
setVisible(visible);
});
// QObject::connect(map, &MapWindow::requestSettings, this, &MapPanel::requestMapSettings);
QObject::connect(map, &MapWindow::requestSettings, [=](bool settings) {
content_stack->setCurrentIndex(settings ? 1 : 0);
});
@ -34,7 +35,13 @@ MapPanel::MapPanel(const QMapboxGLSettings &mapboxSettings, QWidget *parent) : Q
content_stack->addWidget(settings);
}
void MapPanel::mapSettingsRequested() {
void MapPanel::toggleMapSettings() {
emit mapPanelRequested();
setVisible(true);
content_stack->setCurrentIndex((content_stack->currentIndex() + 1) % 2);
}
void MapPanel::requestMapSettings(bool settings) { // TODO rename requestMapSettings
emit mapPanelRequested();
setVisible(true);
content_stack->setCurrentIndex(1);

@ -14,7 +14,8 @@ signals:
void mapPanelRequested();
public slots:
void mapSettingsRequested();
void requestMapSettings(bool settings);
void toggleMapSettings();
private:

@ -92,7 +92,8 @@ void OnroadWindow::offroadTransition(bool offroad) {
map = m;
QObject::connect(m, &MapPanel::mapPanelRequested, this, &OnroadWindow::mapPanelRequested);
QObject::connect(nvg, &AnnotatedCameraWidget::mapSettingsRequested, m, &MapPanel::mapSettingsRequested);
// QObject::connect(nvg, &AnnotatedCameraWidget::mapSettingsRequested, m, &MapPanel::mapSettingsRequested);
QObject::connect(nvg, &AnnotatedCameraWidget::mapSettingsRequested, m, &MapPanel::toggleMapSettings);
m->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE);
split->insertWidget(0, m);

Loading…
Cancel
Save