From bd89538fca3f558f452ebf11c3dc3826ddc5e49b Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Fri, 14 May 2021 07:51:18 +0200 Subject: [PATCH] * Dropped now useless get/set focus methods from tLabel. --- ffpreview.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) 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): -- 2.30.2