From 36917ab74d7f57de2e05ef5da7068c3f688cb029 Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Thu, 5 May 2011 21:34:26 -0700 Subject: [PATCH] Slight visual improvement to chum groups --- TODO.mkdn | 1 + pesterchum.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/TODO.mkdn b/TODO.mkdn index f9435a5..7d43f70 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -20,6 +20,7 @@ Bugs * Windows XP SP2: sometimes mouse clicks dont register? must be some kinda crash * Leave memos on reconnect, needs to auto-rejoin memos * Leave memos on profile change (should just change nick) +* When using mood sort, scroll position jumps to last selected chum Mac Bugs -------- diff --git a/pesterchum.py b/pesterchum.py index fca6112..57012e9 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -634,9 +634,11 @@ class chumArea(RightClickTree): self.setSortingEnabled(False) self.header().hide() self.setDropIndicatorShown(True) - self.setIndentation(0) + self.setIndentation(4) self.setDragEnabled(True) self.setDragDropMode(QtGui.QAbstractItemView.InternalMove) + self.setAnimated(True) + self.setRootIsDecorated(False) self.connect(self, QtCore.SIGNAL('itemDoubleClicked(QTreeWidgetItem *, int)'), self, QtCore.SLOT('expandGroup()')) @@ -939,6 +941,7 @@ class chumArea(RightClickTree): for i in range(self.topLevelItemCount()): self.topLevelItem(i).sortChildren(0, QtCore.Qt.AscendingOrder) def moodSort(self, group): + scrollPos = self.verticalScrollBar().sliderPosition() chums = [] listing = self.topLevelItem(group).child(0) while listing is not None: @@ -947,6 +950,7 @@ class chumArea(RightClickTree): chums.sort(key=lambda x: ((999 if x.chum.mood.value() == 2 else x.chum.mood.value()), x.chum.handle), reverse=False) for c in chums: self.topLevelItem(group).addChild(c) + self.verticalScrollBar().setSliderPosition(scrollPos) @QtCore.pyqtSlot() def activateChum(self):