From 94c3bf4aa68f165fc409d41579b5b22bf947a380 Mon Sep 17 00:00:00 2001 From: Et0h Date: Fri, 24 Oct 2014 23:58:36 +0100 Subject: [PATCH] Tidy up user file offset code --- syncplay/ui/gui.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index 25d405d..c1ff3e2 100644 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -15,8 +15,6 @@ class UserlistItemDelegate(QtGui.QStyledItemDelegate): def paint(self, itemQPainter, optionQStyleOptionViewItem, indexQModelIndex): column = indexQModelIndex.column() if column == 0: - isRoomRow = indexQModelIndex.parent() == indexQModelIndex.parent().parent() - itemQPainter.resetTransform() currentQAbstractItemModel = indexQModelIndex.model() itemQModelIndex = currentQAbstractItemModel.index(indexQModelIndex.row(), 0, indexQModelIndex.parent()) if sys.platform.startswith('win'): @@ -46,7 +44,8 @@ class UserlistItemDelegate(QtGui.QStyledItemDelegate): (optionQStyleOptionViewItem.rect.x()-10), optionQStyleOptionViewItem.rect.y(), crossIconQPixmap.scaled(16, 16, Qt.KeepAspectRatio)) - if not isRoomRow: + isUserRow = indexQModelIndex.parent() != indexQModelIndex.parent().parent() + if isUserRow: optionQStyleOptionViewItem.rect.setX(optionQStyleOptionViewItem.rect.x()+21) QtGui.QStyledItemDelegate.paint(self, itemQPainter, optionQStyleOptionViewItem, indexQModelIndex)