From: azv Date: Fri, 6 Sep 2019 11:20:21 +0000 (+0300) Subject: Merge remote-tracking branch 'remotes/origin/master' into CEA_2019 X-Git-Tag: V9_4_0a2~4^2~130 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8038897b81335a9ec1ff08522ff652299cd2ff3f;p=modules%2Fshaper.git Merge remote-tracking branch 'remotes/origin/master' into CEA_2019 # Conflicts: # src/PartSet/PartSet_SketcherMgr.cpp --- 8038897b81335a9ec1ff08522ff652299cd2ff3f diff --cc src/ModuleBase/ModuleBase_Tools.cpp index eb66062e8,a3c4d0ebd..83d25c2ad --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@@ -152,10 -154,9 +154,9 @@@ void activateWindow(QWidget* theWidget void setFocus(QWidget* theWidget, const QString& theInfo) { - activateWindow(theWidget); theWidget->setFocus(); // rectangle of focus is not visible on tool button widgets - theWidget->repaint(); + theWidget->update(); #ifdef DEBUG_SET_FOCUS qDebug(QString("setFocus: %1").arg(theInfo).toStdString().c_str()); #endif diff --cc src/PartSet/PartSet_SketcherMgr.cpp index 669e8ee95,e936d729b..1c4c03e07 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@@ -466,45 -466,27 +470,44 @@@ void PartSet_SketcherMgr::onMouseReleas bool aWasDragging = myIsDragging; myIsDragging = false; - if (myModule->sketchReentranceMgr()->processMouseReleased(theWnd, theEvent)) + if (myModule->sketchReentranceMgr()->processMouseReleased(theWnd, theEvent)) { return; - + } // if mouse is pressed when it was over view and at release the mouse is out of view, do nothing - if (!myIsMouseOverViewProcessed) + if (!myIsMouseOverViewProcessed) { return; - + } - ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); ModuleBase_IViewer* aViewer = aWorkshop->viewer(); - if (!aViewer->canDragByMouse()) - return; - ModuleBase_Operation* aOp = getCurrentOperation(); + //if (!aViewer->canDragByMouse()) + // return; + ModuleBase_OperationFeature* aOp = + dynamic_cast(getCurrentOperation()); if (aOp) { - if (isNestedSketchOperation(aOp)) { - // Only for sketcher operations - if (aWasDragging) { - if (myDragDone) { - /// the previous selection is lost by mouse release in the viewer(Select method), but - /// it is still stored in myCurrentSelection. So, it is possible to restore selection - /// It is important for drag(edit with mouse) of sketch entities. - restoreSelection(myCurrentSelection); - myCurrentSelection.clear(); + bool aStartNoDragOperation = !aViewer->canDragByMouse() && aOp->isEditOperation(); + if (aStartNoDragOperation || myNoDragMoving) { + // Process edit operation without dragging + if (myCurrentSelection.size() > 0) + myNoDragMoving = !myNoDragMoving; + else + myNoDragMoving = false; + if (myNoDragMoving) + return; + else { + restoreSelection(myCurrentSelection); + myCurrentSelection.clear(); + } + } + else { + if (isNestedSketchOperation(aOp)) { + // Only for sketcher operations + if (aWasDragging) { + if (myDragDone) { + /// the previous selection is lost by mouse release in the viewer(Select method), but + /// it is still stored in myCurrentSelection. So, it is possible to restore selection + /// It is important for drag(edit with mouse) of sketch entities. + restoreSelection(myCurrentSelection); + myCurrentSelection.clear(); + } } } } diff --cc src/XGUI/XGUI_ContextMenuMgr.cpp index b1fadf671,226aa30dd..51f9fbec2 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@@ -346,9 -353,16 +353,18 @@@ void XGUI_ContextMenuMgr::updateObjectB action("SHOW_ONLY_CMD")->setEnabled(true); action("SHADING_CMD")->setEnabled(true); action("WIREFRAME_CMD")->setEnabled(true); + + foreach(ObjectPtr aObj, aObjects) { + FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + if (!aFeature->isInHistory()) { + canBeDeleted = false; + break; + } + } + action("DELETE_CMD")->setEnabled(canBeDeleted); } + if (hasFeature && myWorkshop->canMoveFeature()) + action("MOVE_CMD")->setEnabled(true); } // end multi-selection // Check folder management commands state if only features are selected