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: 71e001ee577811d2bf1ea1973545322c6a3ba95d
This commit is contained in:
Shane Smiskol
2023-07-11 00:21:25 -07:00
committed by GitHub
parent c699443eee
commit c9630b0a7a
3 changed files with 6 additions and 3 deletions
+5
View File
@@ -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();
}
+1
View File
@@ -33,6 +33,7 @@ public:
void updateCurrentRoute();
private:
void mousePressEvent(QMouseEvent *ev) override;
void showEvent(QShowEvent *event) override;
void refresh();
-3
View File
@@ -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