mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-25 07:52:03 +08:00
Revert "UI: Indicate when Nav on OP is enabled (#28665)"
This reverts commit a66135665c.
This commit is contained in:
@@ -64,20 +64,9 @@ void OnroadWindow::updateState(const UIState &s) {
|
||||
|
||||
nvg->updateState(s);
|
||||
|
||||
// update spacing
|
||||
bool navDisabledNow = (*s.sm)["controlsState"].getControlsState().getEnabled() &&
|
||||
!(*s.sm)["modelV2"].getModelV2().getNavEnabled();
|
||||
if (navDisabled != navDisabledNow) {
|
||||
split->setSpacing(navDisabledNow ? UI_BORDER_SIZE * 2 : 0);
|
||||
if (map) {
|
||||
map->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE * (navDisabledNow ? 2 : 1));
|
||||
}
|
||||
}
|
||||
|
||||
// repaint border
|
||||
if (bg != bgColor || navDisabled != navDisabledNow) {
|
||||
if (bg != bgColor) {
|
||||
// repaint border
|
||||
bg = bgColor;
|
||||
navDisabled = navDisabledNow;
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -90,7 +79,6 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
|
||||
return;
|
||||
}
|
||||
map->setVisible(!sidebarVisible && !map->isVisible());
|
||||
update();
|
||||
}
|
||||
#endif
|
||||
// propagation event to parent(HomeWindow)
|
||||
@@ -121,13 +109,6 @@ void OnroadWindow::offroadTransition(bool offroad) {
|
||||
void OnroadWindow::paintEvent(QPaintEvent *event) {
|
||||
QPainter p(this);
|
||||
p.fillRect(rect(), QColor(bg.red(), bg.green(), bg.blue(), 255));
|
||||
|
||||
if (isMapVisible() && navDisabled) {
|
||||
QRect map_r = uiState()->scene.map_on_left
|
||||
? QRect(0, 0, width() / 2, height())
|
||||
: QRect(width() / 2, 0, width() / 2, height());
|
||||
p.fillRect(map_r, bg_colors[STATUS_DISENGAGED]);
|
||||
}
|
||||
}
|
||||
|
||||
// ***** onroad widgets *****
|
||||
|
||||
@@ -129,7 +129,6 @@ private:
|
||||
QColor bg = bg_colors[STATUS_DISENGAGED];
|
||||
QWidget *map = nullptr;
|
||||
QHBoxLayout* split;
|
||||
bool navDisabled = false;
|
||||
|
||||
private slots:
|
||||
void offroadTransition(bool offroad);
|
||||
|
||||
Reference in New Issue
Block a user