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

@@ -142,15 +142,18 @@ SbBool TinkerCADNavigationStyle::processSoEvent(const SoEvent * const ev)
this->centerTime = ev->getTime();
processed = true;
}
else if (!press && curmode == NavigationStyle::DRAGGING && hasDragged) {
// Don't show the context menu after dragging, panning or zooming
else if (!press && (hasDragged || hasPanned || hasZoomed)) {
processed = true;
}
else if (!press && curmode == NavigationStyle::DRAGGING && !hasDragged) {
else if (!press) {
newmode = NavigationStyle::IDLE;
if (!viewer->isEditing()) {
// If we are in drag mode but mouse hasn't been moved open the context-menu
if (this->isPopupMenuEnabled()) {
this->openPopupMenu(event->getPosition());
if (this->currentmode != NavigationStyle::ZOOMING &&
this->currentmode != NavigationStyle::PANNING) {
if (this->isPopupMenuEnabled()) {
this->openPopupMenu(event->getPosition());
}
}
processed = true;
}