mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-13 13:22:22 +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: 71e001ee577811d2bf1ea1973545322c6a3ba95d
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