From 124c93b1d4d264455cf7e56860c36a0867ebf40a Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Thu, 23 Jun 2011 00:13:26 -0700 Subject: [PATCH] Don't animate except on current tab --- TODO.mkdn | 1 - convo.py | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/TODO.mkdn b/TODO.mkdn index dda872e..95813b8 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -11,7 +11,6 @@ Features * Turn @ and # links on/off? * "someone has friended you" notifier * MSPA update notifier option -* Don't animate emotes not in current tab * Show true bans? * Colour saving boxes things? diff --git a/convo.py b/convo.py index 3b538bd..ad05dc6 100644 --- a/convo.py +++ b/convo.py @@ -243,9 +243,16 @@ class PesterText(QtGui.QTextEdit): url = self.urls[movie].toString() html = unicode(self.toHtml()) if html.find(url) != -1: - self.document().addResource(QtGui.QTextDocument.ImageResource, - self.urls[movie], movie.currentPixmap()) - self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth()) + if self.parent().parent(): + i = self.parent().parent().tabIndices[self.parent().title()] + if self.parent().parent().tabs.currentIndex() == i: + self.document().addResource(QtGui.QTextDocument.ImageResource, + self.urls[movie], movie.currentPixmap()) + self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth()) + else: + self.document().addResource(QtGui.QTextDocument.ImageResource, + self.urls[movie], movie.currentPixmap()) + self.setLineWrapColumnOrWidth(self.lineWrapColumnOrWidth()) @QtCore.pyqtSlot(bool) def animateChanged(self, animate): if animate: