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
pull/28874/head
Shane Smiskol 2 years ago committed by GitHub
parent 69e7f386a7
commit 71e001ee57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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