Beispiel #1
0
    def setTabTextColor(self, w, color=None):
        """ Set the tab text color on a particular widget w
        """
        tw, tidx = self._tab_widget(w)

        if tw is not None:
            if color is None:
                # null color reverts to foreground role color
                color = QtGui.QColor()
            tw.tabBar().setTabTextColor(tidx, color)
Beispiel #2
0
def rgba2color(rgba):
    '''
    @param rgba: A html formated color string i.e.: #RRGGBB or #RRGGBBAA
    @return: If rgba is a valid color, a QColor isntance
    '''
    rgba = unicode(rgba).strip('#')
    if len(rgba) in [6, 8]:
        red, green, blue, alpha = rgba[0:2], rgba[2:4], rgba[4:6], rgba[6:8]
    else:
        raise ValueError("Invalid RGBA value %s", rgba)
    return QtGui.QColor(int(red, 16), int(green, 16), int(blue, 16),
                        int(alpha or 'FF', 16))
Beispiel #3
0
    def __init__(self, pixmap):
        QtGui.QSplashScreen.__init__(self, pixmap)
        self.defaultAlignment = QtCore.Qt.AlignCenter
        self.defaultColor = QtCore.Qt.black
        self.shadowColor = QtGui.QColor(QtCore.Qt.black)
        self.shadowColor.setAlpha(128)
        self.message = ""
        self.color = self.alignment = None

        self.textRect = QtCore.QRect(self.rect().x() + 100,
                                     self.rect().y() + 510, 260, 50)
        self.shadowTextRect = QtCore.QRect(self.rect().x() + 101,
                                           self.rect().y() + 511, 260, 50)
Beispiel #4
0
 def textCharFormat_extraSelection_builder(self):
     format = QtGui.QTextCharFormat()
     color = QtGui.QColor(self.editor.colours['selection'])
     color.setAlpha(128)
     format.setBackground(color)
     return format