Don't show context menu when a clickable tool is assigned to the right button.

This commit is contained in:
Leonardo Zide 2020-12-28 10:42:51 -08:00
parent 542304f82e
commit 7c9e3a34ee
2 changed files with 8 additions and 1 deletions

View file

@ -3027,6 +3027,7 @@ void lcView::CancelTrackingOrClearSelection()
void lcView::OnButtonDown(lcTrackButton TrackButton)
{
lcModel* ActiveModel = GetActiveModel();
mToolClicked = false;
switch (mTrackTool)
{
@ -3045,6 +3046,7 @@ void lcView::OnButtonDown(lcTrackButton TrackButton)
if ((mMouseModifiers & Qt::ControlModifier) == 0)
gMainWindow->SetTool(lcTool::Select);
mToolClicked = true;
UpdateTrackTool();
}
break;
@ -3056,6 +3058,7 @@ void lcView::OnButtonDown(lcTrackButton TrackButton)
if ((mMouseModifiers & Qt::ControlModifier) == 0)
gMainWindow->SetTool(lcTool::Select);
mToolClicked = true;
UpdateTrackTool();
}
break;
@ -3108,14 +3111,17 @@ void lcView::OnButtonDown(lcTrackButton TrackButton)
case lcTrackTool::Eraser:
ActiveModel->EraserToolClicked(FindObjectUnderPointer(false, false).Object);
mToolClicked = true;
break;
case lcTrackTool::Paint:
ActiveModel->PaintToolClicked(FindObjectUnderPointer(true, false).Object);
mToolClicked = true;
break;
case lcTrackTool::ColorPicker:
ActiveModel->ColorPickerToolClicked(FindObjectUnderPointer(true, false).Object);
mToolClicked = true;
break;
case lcTrackTool::Zoom:
@ -3228,7 +3234,7 @@ void lcView::OnRightButtonDown()
void lcView::OnRightButtonUp()
{
bool ShowMenu = mTrackButton == lcTrackButton::None || !mTrackUpdated;
bool ShowMenu = !mToolClicked && (mTrackButton == lcTrackButton::None || !mTrackUpdated);
if (mTrackButton != lcTrackButton::None)
StopTracking(mTrackButton == lcTrackButton::Right);

View file

@ -288,6 +288,7 @@ protected:
Qt::KeyboardModifiers mMouseModifiers = Qt::NoModifier;
bool mTrackUpdated = false;
bool mToolClicked = false;
lcTrackTool mTrackTool = lcTrackTool::None;
lcTrackButton mTrackButton = lcTrackButton::None;
lcCursor mCursor = lcCursor::Default;