Exemplo n.º 1
0
    def change_palette(self, color):
        '''Sets the global tooltip background to the given color and initializes reset'''
        p = QPalette(self.default_palette)
        p.setColor(QPalette.All, QPalette.ToolTipBase, color)
        QToolTip.setPalette(p)

        self.timer = QTimer()
        self.timer.timeout.connect(self.try_reset_palette)
        self.timer.start(300) #short enough not to flicker a wrongly colored tooltip
Exemplo n.º 2
0
    def change_palette(self, color):
        """Sets the global tooltip background to the given color and initializes reset"""
        self.old_palette = QToolTip.palette()
        p = QPalette(self.old_palette)
        p.setColor(QPalette.All, QPalette.ToolTipBase, color)
        QToolTip.setPalette(p)

        self.timer = QTimer()
        self.timer.timeout.connect(self.try_reset_palette)
        self.timer.start(
            300)  #short enough not to flicker a wrongly colored tooltip
Exemplo n.º 3
0
 def try_reset_palette(self):
     """Resets the global tooltip background color as soon as the swatch is hidden"""
     if self.old_palette is not None and not QToolTip.isVisible():
         QToolTip.setPalette(self.old_palette)
         self.old_palette = None
Exemplo n.º 4
0
 def try_reset_palette(self):
     '''Resets the global tooltip background color as soon as the swatch is hidden'''
     if self.old_palette is not None and not QToolTip.isVisible():
         QToolTip.setPalette(self.old_palette)
         self.old_palette = None
Exemplo n.º 5
0
 def try_reset_palette(self):
     '''Resets the global tooltip background color as soon as the swatch is hidden'''
     if not QToolTip.isVisible():
         QToolTip.setPalette(self.default_palette)