Commit 3432c288 authored by Dan Pascu's avatar Dan Pascu

Do not start DND when pressing on the collapse button and then dragging

parent 5c1ff76a
......@@ -229,10 +229,12 @@ class ContactGroupWidget(base_class, ui_class):
self.name = name
self.selected = False
self.drop_indicator = None
self._disable_dnd = False
self.setFocusProxy(parent)
self.label_widget.setFocusProxy(self)
self.name_view.setCurrentWidget(self.label_widget)
self.name_editor.editingFinished.connect(self._end_editing)
self.collapse_button.pressed.connect(self._collapse_button_pressed)
@property
def editing(self):
......@@ -287,6 +289,18 @@ class ContactGroupWidget(base_class, ui_class):
def edit(self):
self._start_editing()
def _collapse_button_pressed(self):
self._disable_dnd = True
def mousePressEvent(self, event):
self._disable_dnd = False
super(ContactGroupWidget, self).mousePressEvent(event)
def mouseMoveEvent(self, event):
if self._disable_dnd:
return
super(ContactGroupWidget, self).mouseMoveEvent(event)
def paintEvent(self, event):
painter = QPainter(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment