* Dropped now useless get/set focus methods from tLabel.
authorUrban Wallasch <urban.wallasch@freenet.de>
Fri, 14 May 2021 05:51:18 +0000 (07:51 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Fri, 14 May 2021 05:51:18 +0000 (07:51 +0200)
ffpreview.py

index b7e9f6827c7121e48e870f11640f6b21aec6b6bd..fe3c4b1851dc83d252fd16400fa642b2cc0add99 100755 (executable)
@@ -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):