mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Merge branch 'master' into dev
This commit is contained in:
commit
97b9de47b4
166 changed files with 13682 additions and 9161 deletions
|
@ -420,14 +420,60 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent)
|
|||
// mouse anywhere
|
||||
if (!evt.Dragging() && !evt.Leaving() && !evt.Entering() && (m_mouse_capture.parent != nullptr))
|
||||
{
|
||||
if (m_mouse_capture.any() && (evt.LeftUp() || evt.MiddleUp() || evt.RightUp()))
|
||||
if (m_mouse_capture.any() && (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())) {
|
||||
// prevents loosing selection into the scene if mouse down was done inside the toolbar and mouse up was down outside it,
|
||||
// as when switching between views
|
||||
processed = true;
|
||||
|
||||
m_mouse_capture.reset();
|
||||
if (contains_mouse(mouse_pos, parent) == -1)
|
||||
// mouse is outside the toolbar
|
||||
m_tooltip.clear();
|
||||
return true;
|
||||
}
|
||||
m_mouse_capture.reset();
|
||||
}
|
||||
|
||||
#if ENABLE_MODIFIED_TOOLBAR_MOUSE_EVENT_HANDLING
|
||||
if (evt.Moving())
|
||||
m_tooltip = update_hover_state(mouse_pos, parent);
|
||||
else if (evt.LeftUp())
|
||||
{
|
||||
if (m_mouse_capture.left)
|
||||
{
|
||||
processed = true;
|
||||
m_mouse_capture.left = false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else if (evt.MiddleUp())
|
||||
{
|
||||
if (m_mouse_capture.middle)
|
||||
{
|
||||
processed = true;
|
||||
m_mouse_capture.middle = false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else if (evt.RightUp())
|
||||
{
|
||||
if (m_mouse_capture.right)
|
||||
{
|
||||
processed = true;
|
||||
m_mouse_capture.right = false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else if (evt.Dragging())
|
||||
{
|
||||
if (m_mouse_capture.any())
|
||||
// if the button down was done on this toolbar, prevent from dragging into the scene
|
||||
processed = true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (evt.Moving())
|
||||
m_tooltip = update_hover_state(mouse_pos, parent);
|
||||
else if (evt.LeftUp())
|
||||
|
@ -439,6 +485,7 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent)
|
|||
else if (evt.Dragging() && m_mouse_capture.any())
|
||||
// if the button down was done on this toolbar, prevent from dragging into the scene
|
||||
processed = true;
|
||||
#endif // ENABLE_MODIFIED_TOOLBAR_MOUSE_EVENT_HANDLING
|
||||
|
||||
int item_id = contains_mouse(mouse_pos, parent);
|
||||
if (item_id == -1)
|
||||
|
@ -478,8 +525,10 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent)
|
|||
parent.set_as_dirty();
|
||||
}
|
||||
}
|
||||
#if !ENABLE_MODIFIED_TOOLBAR_MOUSE_EVENT_HANDLING
|
||||
else if (evt.LeftUp())
|
||||
processed = true;
|
||||
#endif // !ENABLE_MODIFIED_TOOLBAR_MOUSE_EVENT_HANDLING
|
||||
}
|
||||
|
||||
return processed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue