mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Don't show context menu when a clickable tool is assigned to the right button.
This commit is contained in:
parent
542304f82e
commit
7c9e3a34ee
2 changed files with 8 additions and 1 deletions
|
@ -3027,6 +3027,7 @@ void lcView::CancelTrackingOrClearSelection()
|
||||||
void lcView::OnButtonDown(lcTrackButton TrackButton)
|
void lcView::OnButtonDown(lcTrackButton TrackButton)
|
||||||
{
|
{
|
||||||
lcModel* ActiveModel = GetActiveModel();
|
lcModel* ActiveModel = GetActiveModel();
|
||||||
|
mToolClicked = false;
|
||||||
|
|
||||||
switch (mTrackTool)
|
switch (mTrackTool)
|
||||||
{
|
{
|
||||||
|
@ -3045,6 +3046,7 @@ void lcView::OnButtonDown(lcTrackButton TrackButton)
|
||||||
if ((mMouseModifiers & Qt::ControlModifier) == 0)
|
if ((mMouseModifiers & Qt::ControlModifier) == 0)
|
||||||
gMainWindow->SetTool(lcTool::Select);
|
gMainWindow->SetTool(lcTool::Select);
|
||||||
|
|
||||||
|
mToolClicked = true;
|
||||||
UpdateTrackTool();
|
UpdateTrackTool();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3056,6 +3058,7 @@ void lcView::OnButtonDown(lcTrackButton TrackButton)
|
||||||
if ((mMouseModifiers & Qt::ControlModifier) == 0)
|
if ((mMouseModifiers & Qt::ControlModifier) == 0)
|
||||||
gMainWindow->SetTool(lcTool::Select);
|
gMainWindow->SetTool(lcTool::Select);
|
||||||
|
|
||||||
|
mToolClicked = true;
|
||||||
UpdateTrackTool();
|
UpdateTrackTool();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3108,14 +3111,17 @@ void lcView::OnButtonDown(lcTrackButton TrackButton)
|
||||||
|
|
||||||
case lcTrackTool::Eraser:
|
case lcTrackTool::Eraser:
|
||||||
ActiveModel->EraserToolClicked(FindObjectUnderPointer(false, false).Object);
|
ActiveModel->EraserToolClicked(FindObjectUnderPointer(false, false).Object);
|
||||||
|
mToolClicked = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcTrackTool::Paint:
|
case lcTrackTool::Paint:
|
||||||
ActiveModel->PaintToolClicked(FindObjectUnderPointer(true, false).Object);
|
ActiveModel->PaintToolClicked(FindObjectUnderPointer(true, false).Object);
|
||||||
|
mToolClicked = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcTrackTool::ColorPicker:
|
case lcTrackTool::ColorPicker:
|
||||||
ActiveModel->ColorPickerToolClicked(FindObjectUnderPointer(true, false).Object);
|
ActiveModel->ColorPickerToolClicked(FindObjectUnderPointer(true, false).Object);
|
||||||
|
mToolClicked = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case lcTrackTool::Zoom:
|
case lcTrackTool::Zoom:
|
||||||
|
@ -3228,7 +3234,7 @@ void lcView::OnRightButtonDown()
|
||||||
|
|
||||||
void lcView::OnRightButtonUp()
|
void lcView::OnRightButtonUp()
|
||||||
{
|
{
|
||||||
bool ShowMenu = mTrackButton == lcTrackButton::None || !mTrackUpdated;
|
bool ShowMenu = !mToolClicked && (mTrackButton == lcTrackButton::None || !mTrackUpdated);
|
||||||
|
|
||||||
if (mTrackButton != lcTrackButton::None)
|
if (mTrackButton != lcTrackButton::None)
|
||||||
StopTracking(mTrackButton == lcTrackButton::Right);
|
StopTracking(mTrackButton == lcTrackButton::Right);
|
||||||
|
|
|
@ -288,6 +288,7 @@ protected:
|
||||||
Qt::KeyboardModifiers mMouseModifiers = Qt::NoModifier;
|
Qt::KeyboardModifiers mMouseModifiers = Qt::NoModifier;
|
||||||
|
|
||||||
bool mTrackUpdated = false;
|
bool mTrackUpdated = false;
|
||||||
|
bool mToolClicked = false;
|
||||||
lcTrackTool mTrackTool = lcTrackTool::None;
|
lcTrackTool mTrackTool = lcTrackTool::None;
|
||||||
lcTrackButton mTrackButton = lcTrackButton::None;
|
lcTrackButton mTrackButton = lcTrackButton::None;
|
||||||
lcCursor mCursor = lcCursor::Default;
|
lcCursor mCursor = lcCursor::Default;
|
||||||
|
|
Loading…
Add table
Reference in a new issue