From: asl Date: Fri, 22 Sep 2017 08:34:54 +0000 (+0300) Subject: refs #1324: only panning by button can be chained X-Git-Tag: v2.1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=47c6625157a5417718a2b26095a6b792ade89802;p=modules%2Fgui.git refs #1324: only panning by button can be chained --- diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 45a9f37c0..cfeb79fb4 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -276,6 +276,7 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop* theDesktop, mySelectionEnabled = true; myCursorIsHand = false; + myPanningByBtn = false; clearViewAspects(); } @@ -625,6 +626,12 @@ void OCCViewer_ViewWindow::activateZoom() } +void OCCViewer_ViewWindow::onPanning() +{ + myPanningByBtn = true; + activatePanning(); +} + /*! \brief Start panning operation. @@ -1072,7 +1079,7 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent) { OCCViewer_ViewManager* aMgr = dynamic_cast( getViewManager() ); bool isChained = aMgr->isChainedOperations(); - bool isReset = !( myOperation==PANVIEW && isChained ) || theEvent->button() == Qt::RightButton; + bool isReset = !( myOperation==PANVIEW && myPanningByBtn && isChained ) || theEvent->button() == Qt::RightButton; if( isReset ) resetState(); break; @@ -1242,7 +1249,7 @@ void OCCViewer_ViewWindow::createActions() aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_PAN" ) ), tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); - connect(aAction, SIGNAL(triggered()), this, SLOT(activatePanning())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onPanning())); toolMgr()->registerAction( aAction, PanId ); // Global Panning diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index e83fe217e..c68465fa5 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -308,6 +308,7 @@ public slots: virtual void onRayTracing(); virtual void onEnvTexture(); virtual void onLightSource(); + virtual void onPanning(); virtual void activateSetRotationGravity(); virtual void activateSetRotationSelected( double theX, double theY, double theZ ); @@ -430,6 +431,7 @@ private: Handle(V3d_Plane) myReserveClipPlane; viewAspectList myViewAspects; + bool myPanningByBtn; }; #ifdef WIN32