mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user