mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-21 04:42:33 +08:00
ui: fix onroad transition with active nav (#23757)
This commit is contained in:
@@ -80,11 +80,15 @@ void OnroadWindow::offroadTransition(bool offroad) {
|
||||
if (!offroad) {
|
||||
if (map == nullptr && (uiState()->prime_type || !MAPBOX_TOKEN.isEmpty())) {
|
||||
MapWindow * m = new MapWindow(get_mapbox_settings());
|
||||
m->setFixedWidth(topWidget(this)->width() / 2);
|
||||
m->offroadTransition(offroad);
|
||||
QObject::connect(uiState(), &UIState::offroadTransition, m, &MapWindow::offroadTransition);
|
||||
split->addWidget(m, 0, Qt::AlignRight);
|
||||
map = m;
|
||||
|
||||
QObject::connect(uiState(), &UIState::offroadTransition, m, &MapWindow::offroadTransition);
|
||||
|
||||
m->setFixedWidth(topWidget(this)->width() / 2);
|
||||
split->addWidget(m, 0, Qt::AlignRight);
|
||||
|
||||
// Make map visible after adding to split
|
||||
m->offroadTransition(offroad);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-3
@@ -208,7 +208,7 @@ void UIState::updateStatus() {
|
||||
}
|
||||
|
||||
// Handle onroad/offroad transition
|
||||
if (scene.started != started_prev) {
|
||||
if (scene.started != started_prev || sm->frame == 1) {
|
||||
if (scene.started) {
|
||||
status = STATUS_DISENGAGED;
|
||||
scene.started_frame = sm->frame;
|
||||
@@ -217,8 +217,6 @@ void UIState::updateStatus() {
|
||||
}
|
||||
started_prev = scene.started;
|
||||
emit offroadTransition(!scene.started);
|
||||
} else if (sm->frame == 1) {
|
||||
emit offroadTransition(!scene.started);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ private slots:
|
||||
|
||||
private:
|
||||
QTimer *timer;
|
||||
bool started_prev = true;
|
||||
bool started_prev = false;
|
||||
};
|
||||
|
||||
UIState *uiState();
|
||||
|
||||
Reference in New Issue
Block a user