diff --git a/selfdrive/ui/qt/maps/map_panel.cc b/selfdrive/ui/qt/maps/map_panel.cc index c4cc20e21..ff19f6c25 100644 --- a/selfdrive/ui/qt/maps/map_panel.cc +++ b/selfdrive/ui/qt/maps/map_panel.cc @@ -41,3 +41,11 @@ void MapPanel::toggleMapSettings() { emit mapPanelRequested(); show(); } + +void MapPanel::showEvent(QShowEvent *event) { + uiState()->scene.map_open = true; +} + +void MapPanel::hideEvent(QHideEvent *event) { + uiState()->scene.map_open = false; +} diff --git a/selfdrive/ui/qt/maps/map_panel.h b/selfdrive/ui/qt/maps/map_panel.h index 190bb6344..4e1af240f 100644 --- a/selfdrive/ui/qt/maps/map_panel.h +++ b/selfdrive/ui/qt/maps/map_panel.h @@ -18,4 +18,8 @@ public slots: private: QStackedLayout *content_stack; + + // FrogPilot widgets + void hideEvent(QHideEvent *event); + void showEvent(QShowEvent *event); }; diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 7238159dd..57ccda194 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -101,6 +101,10 @@ typedef struct UIScene { bool started, ignition, is_metric, map_on_left, longitudinal_control; bool world_objects_visible = false; uint64_t started_frame; + + // FrogPilot variables + bool map_open; + } UIScene; class UIState : public QObject {