Gui: Prevent showing the context menu after dragging, panning or zooming

This commit is contained in:
Rexbas
2024-01-20 16:27:25 +01:00
parent 62c3836c97
commit dfa20b4648
10 changed files with 76 additions and 71 deletions

View File

@@ -144,16 +144,17 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
// If we are in edit mode then simply ignore the RMB events
// to pass the event to the base class.
this->lockrecenter = true;
if (!viewer->isEditing()) {
// If we are in zoom or pan mode ignore RMB events otherwise
// the canvas doesn't get any release events
// Don't show the context menu after dragging, panning or zooming
if (!press && (hasDragged || hasPanned || hasZoomed)) {
processed = true;
}
if (!press && !viewer->isEditing()) {
if (this->currentmode != NavigationStyle::ZOOMING &&
this->currentmode != NavigationStyle::PANNING &&
this->currentmode != NavigationStyle::DRAGGING) {
if (this->isPopupMenuEnabled()) {
if (!press) { // release right mouse button
this->openPopupMenu(event->getPosition());
}
this->openPopupMenu(event->getPosition());
}
}
}