mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-30 22:01:57 +08:00
MSW specific: ObjectList: Fixed false possible DnD, when mouse click outside of ObjectList and than mouse move over the ObjectList.
Fix for #13062 too
This commit is contained in:
parent
d5c7001a7c
commit
92d08da96d
@ -228,6 +228,15 @@ ObjectList::ObjectList(wxWindow* parent) :
|
||||
set_tooltip_for_item(this->get_mouse_position_in_control());
|
||||
event.Skip();
|
||||
});
|
||||
|
||||
GetMainWindow()->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& event) {
|
||||
m_mouse_left_down = true;
|
||||
event.Skip();
|
||||
});
|
||||
GetMainWindow()->Bind(wxEVT_LEFT_UP, [this](wxMouseEvent& event) {
|
||||
m_mouse_left_down = false;
|
||||
event.Skip();
|
||||
});
|
||||
#endif //__WXMSW__
|
||||
|
||||
Bind(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, &ObjectList::OnContextMenu, this);
|
||||
@ -1212,6 +1221,15 @@ void ObjectList::key_event(wxKeyEvent& event)
|
||||
|
||||
void ObjectList::OnBeginDrag(wxDataViewEvent &event)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
if (!m_mouse_left_down) {
|
||||
event.Veto();
|
||||
return;
|
||||
}
|
||||
// Invalidate LeftDown flag emmidiately to avoid its unexpected using next time.
|
||||
m_mouse_left_down = false;
|
||||
#endif // __WXMSW__
|
||||
|
||||
if (m_is_editing_started)
|
||||
m_is_editing_started = false;
|
||||
#ifdef __WXGTK__
|
||||
|
@ -114,6 +114,9 @@ private:
|
||||
int m_selected_layers_range_idx {-1};
|
||||
|
||||
Clipboard m_clipboard;
|
||||
#ifdef __WXMSW__
|
||||
bool m_mouse_left_down{ false };
|
||||
#endif
|
||||
|
||||
struct dragged_item_data
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user