Commit b3a338c4 authored by Dan Pascu's avatar Dan Pascu

Renamed arrow button to collapse_button and updated logic

parent b448c967
......@@ -39,7 +39,7 @@ class ContactGroup(object):
@property
def collapsed(self):
return self.widget.collapsed
return self.widget.collapse_button.isChecked()
def _get_name(self):
return self.__dict__['name']
......@@ -126,10 +126,6 @@ class ContactGroupWidget(base_class, ui_class):
self.name_view.setCurrentWidget(self.label_widget)
self.name_editor.editingFinished.connect(self._end_editing)
@property
def collapsed(self):
return self.arrow.isChecked()
@property
def editing(self):
return self.name_view.currentWidget() is self.editor_widget
......@@ -193,7 +189,7 @@ class ContactGroupWidget(base_class, ui_class):
painter.drawLine(rect.bottomLeft(), rect.bottomRight())
#painter.drawLine(option.rect.topRight(), option.rect.bottomRight())
if self.collapsed:
if self.collapse_button.isChecked():
arrow = QPolygonF([QPointF(0, 0), QPointF(0, 9), QPointF(8, 4.5)])
arrow.translate(QPointF(5, 4))
else:
......@@ -251,7 +247,7 @@ class ContactDelegate(QStyledItemDelegate):
if type(item) is ContactGroup:
if item.widget is Null:
item.widget = ContactGroupWidget(item.name, parent)
item.widget.arrow.toggled.connect(partial(self._update_list_view, item))
item.widget.collapse_button.toggled.connect(partial(self._update_list_view, item))
return item.widget
else:
return None
......
......@@ -21,7 +21,7 @@
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="arrow">
<widget class="QToolButton" name="collapse_button">
<property name="maximumSize">
<size>
<width>18</width>
......@@ -172,8 +172,6 @@ border-width: 0;
</widget>
</item>
</layout>
<zorder>name_label</zorder>
<zorder>name_editor</zorder>
</widget>
<widget class="QWidget" name="editor_widget">
<layout class="QHBoxLayout" name="horizontalLayout_2">
......
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