mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 10:47:50 -06:00
Prevent toolbar clicking when mouse is hovering over layer height editor (#6727)
* Prevent toolbar clicking when mouse is hovering over layer height editor (SoftFever/OrcaSlicer#6713)
This commit is contained in:
parent
5c3e094450
commit
97d4ead854
1 changed files with 9 additions and 10 deletions
|
@ -3968,8 +3968,11 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
printf((format_mouse_event_debug_message(evt) + " - other\n").c_str());
|
printf((format_mouse_event_debug_message(evt) + " - other\n").c_str());
|
||||||
#endif /* SLIC3R_DEBUG_MOUSE_EVENTS */
|
#endif /* SLIC3R_DEBUG_MOUSE_EVENTS */
|
||||||
}
|
}
|
||||||
|
const int selected_object_idx = m_selection.get_object_idx();
|
||||||
|
const int layer_editing_object_idx = is_layers_editing_enabled() ? selected_object_idx : -1;
|
||||||
|
const bool mouse_in_layer_editing = layer_editing_object_idx != -1 && m_layers_editing.bar_rect_contains(*this, pos(0), pos(1));
|
||||||
|
|
||||||
if (m_main_toolbar.on_mouse(evt, *this)) {
|
if (!mouse_in_layer_editing && m_main_toolbar.on_mouse(evt, *this)) {
|
||||||
if (m_main_toolbar.is_any_item_pressed())
|
if (m_main_toolbar.is_any_item_pressed())
|
||||||
m_gizmos.reset_all_states();
|
m_gizmos.reset_all_states();
|
||||||
if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())
|
if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())
|
||||||
|
@ -3979,14 +3982,14 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBS: GUI refactor: GLToolbar
|
//BBS: GUI refactor: GLToolbar
|
||||||
if (m_assemble_view_toolbar.on_mouse(evt, *this)) {
|
if (!mouse_in_layer_editing && m_assemble_view_toolbar.on_mouse(evt, *this)) {
|
||||||
if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())
|
if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())
|
||||||
mouse_up_cleanup();
|
mouse_up_cleanup();
|
||||||
m_mouse.set_start_position_3D_as_invalid();
|
m_mouse.set_start_position_3D_as_invalid();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wxGetApp().plater()->get_collapse_toolbar().on_mouse(evt, *this)) {
|
if (!mouse_in_layer_editing && wxGetApp().plater()->get_collapse_toolbar().on_mouse(evt, *this)) {
|
||||||
if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())
|
if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp())
|
||||||
mouse_up_cleanup();
|
mouse_up_cleanup();
|
||||||
m_mouse.set_start_position_3D_as_invalid();
|
m_mouse.set_start_position_3D_as_invalid();
|
||||||
|
@ -4015,7 +4018,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (m_gizmos.on_mouse(evt)) {
|
if (!mouse_in_layer_editing && m_gizmos.on_mouse(evt)) {
|
||||||
if (m_gizmos.is_running()) {
|
if (m_gizmos.is_running()) {
|
||||||
_deactivate_arrange_menu();
|
_deactivate_arrange_menu();
|
||||||
_deactivate_orient_menu();
|
_deactivate_orient_menu();
|
||||||
|
@ -4067,10 +4070,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
|
|
||||||
bool any_gizmo_active = m_gizmos.get_current() != nullptr;
|
bool any_gizmo_active = m_gizmos.get_current() != nullptr;
|
||||||
|
|
||||||
int selected_object_idx = m_selection.get_object_idx();
|
|
||||||
int layer_editing_object_idx = is_layers_editing_enabled() ? selected_object_idx : -1;
|
|
||||||
|
|
||||||
|
|
||||||
if (m_mouse.drag.move_requires_threshold && m_mouse.is_move_start_threshold_position_2D_defined() && m_mouse.is_move_threshold_met(pos)) {
|
if (m_mouse.drag.move_requires_threshold && m_mouse.is_move_start_threshold_position_2D_defined() && m_mouse.is_move_threshold_met(pos)) {
|
||||||
m_mouse.drag.move_requires_threshold = false;
|
m_mouse.drag.move_requires_threshold = false;
|
||||||
m_mouse.set_move_start_threshold_position_2D_as_invalid();
|
m_mouse.set_move_start_threshold_position_2D_as_invalid();
|
||||||
|
@ -4124,7 +4123,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
|
|
||||||
// If user pressed left or right button we first check whether this happened on a volume or not.
|
// If user pressed left or right button we first check whether this happened on a volume or not.
|
||||||
m_layers_editing.state = LayersEditing::Unknown;
|
m_layers_editing.state = LayersEditing::Unknown;
|
||||||
if (layer_editing_object_idx != -1 && m_layers_editing.bar_rect_contains(*this, pos(0), pos(1))) {
|
if (mouse_in_layer_editing) {
|
||||||
// A volume is selected and the mouse is inside the layer thickness bar.
|
// A volume is selected and the mouse is inside the layer thickness bar.
|
||||||
// Start editing the layer height.
|
// Start editing the layer height.
|
||||||
m_layers_editing.state = LayersEditing::Editing;
|
m_layers_editing.state = LayersEditing::Editing;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue