From: Urban Wallasch Date: Fri, 14 May 2021 05:51:18 +0000 (+0200) Subject: * Dropped now useless get/set focus methods from tLabel. X-Git-Tag: v0.3~61 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=bd89538fca3f558f452ebf11c3dc3826ddc5e49b;p=ffpreview.git * Dropped now useless get/set focus methods from tLabel. --- diff --git a/ffpreview.py b/ffpreview.py index b7e9f68..fe3c4b1 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -337,7 +337,7 @@ class sQIcon(QIcon): super().addPixmap(sQPixmap(imgdata=imgdata)) class tLabel(QWidget): - __slots__ = ['info', 'focus'] + __slots__ = ['info'] def __init__(self, *args, pixmap=None, text=None, info=None, **kwargs): super().__init__(*args, **kwargs) layout = QVBoxLayout(self) @@ -359,16 +359,6 @@ class tLabel(QWidget): self.adjustSize() self.setMaximumSize(self.width(), self.height()) - def setFocus(self): - self.focus = True - self.setStyleSheet('QLabel {background-color: %s;}' % cfg['highlightcolor']) - self.window().statdsp[3].setText(self.info[1]) - - def unsetFocus(self): - self.focus = False - self.setStyleSheet('QLabel {}') - self.window().statdsp[3].setText('') - def mouseReleaseEvent(self, event): self.window().set_cursorw(self) if QApplication.keyboardModifiers() == Qt.ShiftModifier: @@ -520,13 +510,15 @@ class sMainWindow(QMainWindow): return if idx is None: idx = self.cur - l[self.cur].unsetFocus() + l[self.cur].setStyleSheet('QLabel {}') + #self.statdsp[3].setText('') if idx < 0: idx = 0 elif idx >= len(l): idx = len(l) - 1 self.cur = idx - l[self.cur].setFocus() + l[self.cur].setStyleSheet('QLabel {background-color: %s;}' % cfg['highlightcolor']) + self.statdsp[3].setText(l[self.cur].info[1]) self.scroll.ensureWidgetVisible(l[self.cur], 0, 0) def set_cursorw(self, label):