FrogPilot setup - Determine if the map is open
This commit is contained in:
parent
33cf1114dd
commit
370d62789d
|
@ -55,6 +55,7 @@ void HomeWindow::showSidebar(bool show) {
|
|||
|
||||
void HomeWindow::showMapPanel(bool show) {
|
||||
onroad->showMapPanel(show);
|
||||
uiState()->scene.map_open = true;
|
||||
}
|
||||
|
||||
void HomeWindow::updateState(const UIState &s) {
|
||||
|
@ -74,6 +75,7 @@ void HomeWindow::offroadTransition(bool offroad) {
|
|||
slayout->setCurrentWidget(home);
|
||||
} else {
|
||||
slayout->setCurrentWidget(onroad);
|
||||
uiState()->scene.map_open = onroad->isMapVisible();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,6 +93,7 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
|||
// Handle sidebar collapsing
|
||||
if ((onroad->isVisible() || body->isVisible()) && (!sidebar->isVisible() || e->x() > sidebar->width())) {
|
||||
sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible());
|
||||
uiState()->scene.map_open = onroad->isMapVisible();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue