From: vsv Date: Tue, 24 Mar 2020 08:22:42 +0000 (+0300) Subject: Issue #18881(Tuleap): Erase highlighting when mouse is dragging X-Git-Tag: V9_5_0a2~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fef81a8022e85517d8d350b56472b12809ac7b88;p=modules%2Fshaper.git Issue #18881(Tuleap): Erase highlighting when mouse is dragging --- diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 4b82e3ed6..e66a9f060 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -296,36 +296,40 @@ void XGUI_ViewerProxy::onMouseDoubleClick(AppElements_ViewWindow* theWnd, QMouse void XGUI_ViewerProxy::onMouseMove(AppElements_ViewWindow* theWnd, QMouseEvent* theEvent) { - if (myIs2dMode) { - bool aHighlight2d = - ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true); - if (aHighlight2d) { - if (myShowHighlight) - eraseHighlight(); - else - updateHighlight(); - } - else { - if (myShowHighlight) - updateHighlight(); - else - eraseHighlight(); - } - } + if (theEvent->buttons() != Qt::NoButton) + eraseHighlight(); else { - bool aHighlight3d = - ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false); - if (aHighlight3d) { - if (myShowHighlight) - eraseHighlight(); - else - updateHighlight(); + if (myIs2dMode) { + bool aHighlight2d = + ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true); + if (aHighlight2d) { + if (myShowHighlight) + eraseHighlight(); + else + updateHighlight(); + } + else { + if (myShowHighlight) + updateHighlight(); + else + eraseHighlight(); + } } else { - if (myShowHighlight) - updateHighlight(); - else - eraseHighlight(); + bool aHighlight3d = + ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false); + if (aHighlight3d) { + if (myShowHighlight) + eraseHighlight(); + else + updateHighlight(); + } + else { + if (myShowHighlight) + updateHighlight(); + else + eraseHighlight(); + } } } emit mouseMove(theWnd, theEvent); @@ -546,36 +550,40 @@ void XGUI_ViewerProxy::updateHighlight() #ifdef HAVE_SALOME void XGUI_ViewerProxy::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) { - if (myIs2dMode) { - bool aHighlight2d = - ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true); - if (aHighlight2d) { - if (myShowHighlight) - eraseHighlight(); - else - updateHighlight(); - } - else { - if (myShowHighlight) - updateHighlight(); - else - eraseHighlight(); - } - } + if (theEvent->buttons() != Qt::NoButton) + eraseHighlight(); else { - bool aHighlight3d = - ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false); - if (aHighlight3d) { - if (myShowHighlight) - eraseHighlight(); - else - updateHighlight(); + if (myIs2dMode) { + bool aHighlight2d = + ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true); + if (aHighlight2d) { + if (myShowHighlight) + eraseHighlight(); + else + updateHighlight(); + } + else { + if (myShowHighlight) + updateHighlight(); + else + eraseHighlight(); + } } else { - if (myShowHighlight) - updateHighlight(); - else - eraseHighlight(); + bool aHighlight3d = + ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false); + if (aHighlight3d) { + if (myShowHighlight) + eraseHighlight(); + else + updateHighlight(); + } + else { + if (myShowHighlight) + updateHighlight(); + else + eraseHighlight(); + } } } emit mouseMove(theWnd, theEvent);