map settings: accept touch events (#28865)

* accept touch events in map settings

* use override

* revert this

* remove debug stuff

* add comments

* not the main purpose
old-commit-hash: 71e001ee57
beeps
Shane Smiskol 2 years ago committed by GitHub
parent c699443eee
commit c9630b0a7a
  1. 5
      selfdrive/ui/qt/maps/map_settings.cc
  2. 1
      selfdrive/ui/qt/maps/map_settings.h
  3. 3
      selfdrive/ui/qt/onroad.cc

@ -118,6 +118,11 @@ MapSettings::MapSettings(bool closeable, QWidget *parent)
}
}
void MapSettings::mousePressEvent(QMouseEvent *ev) {
// Prevent mouse event from propagating up
ev->accept();
}
void MapSettings::showEvent(QShowEvent *event) {
updateCurrentRoute();
}

@ -33,6 +33,7 @@ public:
void updateCurrentRoute();
private:
void mousePressEvent(QMouseEvent *ev) override;
void showEvent(QShowEvent *event) override;
void refresh();

@ -75,9 +75,6 @@ void OnroadWindow::mousePressEvent(QMouseEvent* e) {
#ifdef ENABLE_MAPS
if (map != nullptr) {
bool sidebarVisible = geometry().x() > 0;
if (map->isVisible() && !((MapPanel *)map)->isShowingMap() && e->windowPos().x() >= 1080) {
return;
}
map->setVisible(!sidebarVisible && !map->isVisible());
}
#endif

Loading…
Cancel
Save