mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
nav fixes
This commit is contained in:
@@ -168,6 +168,9 @@ class NavigationCardRenderer(Widget):
|
||||
if not self._enabled:
|
||||
return
|
||||
|
||||
if not (ui_state.params.get("NavDestination") or ""):
|
||||
return
|
||||
|
||||
raw_state = ui_state.params_memory.get("NavInstructionState") or {}
|
||||
if isinstance(raw_state, str):
|
||||
try:
|
||||
|
||||
@@ -107,6 +107,10 @@ void HudRenderer::updateState(const UIState &s) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.get("NavDestination").empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string nav_state_raw = params_memory.get("NavInstructionState");
|
||||
if (nav_state_raw.empty()) {
|
||||
return;
|
||||
|
||||
@@ -114,6 +114,7 @@ void OnroadWindow::paintEvent(QPaintEvent *event) {
|
||||
|
||||
void OnroadWindow::mousePressEvent(QMouseEvent* mouseEvent) {
|
||||
if (nvg->handleHudPress(mouseEvent->pos())) {
|
||||
grabMouse();
|
||||
mouseEvent->accept();
|
||||
return;
|
||||
}
|
||||
@@ -129,7 +130,12 @@ void OnroadWindow::mousePressEvent(QMouseEvent* mouseEvent) {
|
||||
}
|
||||
|
||||
void OnroadWindow::mouseReleaseEvent(QMouseEvent* mouseEvent) {
|
||||
if (nvg->handleHudRelease(mouseEvent->pos())) {
|
||||
const bool handled = nvg->handleHudRelease(mouseEvent->pos());
|
||||
if (QWidget::mouseGrabber() == this) {
|
||||
releaseMouse();
|
||||
}
|
||||
|
||||
if (handled) {
|
||||
mouseEvent->accept();
|
||||
return;
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user