Esempio n. 1
0
 def iconPath(self):
     """
     :rtype: str
     """
     iconPath = self._settings.get('iconPath', None)
     index = self.treeWidget().indexFromPath(self.path())
     expanded = self.treeWidget().isExpanded(index)
     if not iconPath:
         if 'Trash' in self.name():
             iconPath = studioqt.resource().get('icons', 'delete')
         elif expanded:
             iconPath = studioqt.resource().get('icons', 'folder_open')
         else:
             iconPath = studioqt.resource().get('icons', 'folder')
     return iconPath
Esempio n. 2
0
 def iconPath(self):
     """
     :rtype: str
     """
     iconPath = self._settings.get('iconPath', None)
     index = self.treeWidget().indexFromPath(self.path())
     expanded = self.treeWidget().isExpanded(index)
     if not iconPath:
         if 'Trash' in self.name():
             iconPath = studioqt.resource().get('icons', 'delete')
         elif expanded:
             iconPath = studioqt.resource().get('icons', 'folder_open')
         else:
             iconPath = studioqt.resource().get('icons', 'folder')
     return iconPath
Esempio n. 3
0
 def clear(self):
     self._timer.stop()
     self._button.hide()
     self._label.setText("")
     self._label.setStyleSheet("")
     icon = studioqt.resource().icon("blank")
     self._button.setIcon(icon)
Esempio n. 4
0
    def setIcon(self, column, icon, color=None):
        """
        Set the icon to be displayed in the given column.

        :type column: int or str
        :type icon: QtGui.QIcon
        :rtype: None
        """
        # Safe guard for when the class is being used without the gui.
        isAppRunning = bool(QtWidgets.QApplication.instance())
        if not isAppRunning:
            return

        if isinstance(icon, basestring):
            if not os.path.exists(icon):
                color = color or studioqt.Color(255, 255, 255, 20)
                icon = studioqt.resource().icon("image", color=color)
            else:
                icon = QtGui.QIcon(icon)

        if isinstance(column, basestring):
            self._icon[column] = icon
        else:
            self._pixmap[column] = None
            QtWidgets.QTreeWidgetItem.setIcon(self, column, icon)
Esempio n. 5
0
    def thumbnailPath(self):
        """
        Return the thumbnail location on disc for this item.

        :rtype: str
        """
        return studioqt.resource().get("icons", "thumbnail.png")
Esempio n. 6
0
 def clear(self):
     self._timer.stop()
     self._button.hide()
     self._label.setText('')
     self._label.setStyleSheet('')
     icon = studioqt.resource().icon('blank')
     self._button.setIcon(icon)
Esempio n. 7
0
    def thumbnailPath(self):
        """
        Return the thumbnail location on disc for this item.

        :type libraryWidget: studiolibrary.LibraryWidget
        :rtype: QtWidgets.QWidget
        """
        return studioqt.resource().get("icons", "thumbnail.png")
Esempio n. 8
0
    def setInfo(self, text, msec=DISPLAY_TIME):
        icon = studioqt.resource().icon("info")

        self._button.setIcon(icon)
        self._button.show()

        self._label.setStyleSheet("background-color: rgb(0, 0, 0, 0);")
        self.setText(text, msec)
Esempio n. 9
0
    def iconPath(self):
        """
        :rtype: str
        """
        iconPath = self._settings.get("iconPath", None)

        index = self.treeWidget().indexFromPath(self.path())
        expanded = self.treeWidget().isExpanded(index)

        if not iconPath:
            if "Trash" in self.name():
                iconPath = studioqt.resource().get("icons", "delete")
            elif expanded:
                iconPath = studioqt.resource().get("icons", "folder_open")
            else:
                iconPath = studioqt.resource().get("icons", "folder")

        return iconPath
Esempio n. 10
0
    def setWarning(self, text, msec=DISPLAY_TIME):
        icon = studioqt.resource().icon("warning")

        self._button.setIcon(icon)
        self._button.show()

        self._label.setStyleSheet(
            "color: rgb(222, 180, 0);background-color: rgb(0, 0, 0, 0);")
        self.setText(text, msec)
Esempio n. 11
0
 def styleSheet(self):
     """
     Return the style sheet for this theme.
     
     :rtype: str
     """
     options = self.options()
     path = studioqt.resource().get('css', 'default.css')
     styleSheet = studioqt.StyleSheet.fromPath(path, options=options, dpi=self.dpi())
     return styleSheet.data()
Esempio n. 12
0
    def pixmap(self):
        """
        :rtype: QtGui.QPixmap
        """
        if not self.isIconVisible():
            return studioqt.resource().pixmap("")

        color = self.color()
        iconPath = self.iconPath()

        self._pixmap = studioqt.Pixmap(iconPath)
        if color:
            self._pixmap.setColor(color)

        return self._pixmap
Esempio n. 13
0
 def setIcon(self, column, icon, color=None):
     """
     Set the icon to be displayed in the given column.
     
     :type column: int or str
     :type icon: QtGui.QIcon
     :rtype: None
     """
     if isinstance(icon, basestring):
         if not os.path.exists(icon):
             color = color or studioqt.Color(255, 255, 255, 20)
             icon = studioqt.resource().icon('image', color=color)
         else:
             icon = QtGui.QIcon(icon)
     if isinstance(column, basestring):
         self._icon[column] = icon
     else:
         self._pixmap[column] = None
         QtWidgets.QTreeWidgetItem.setIcon(self, column, icon)
 def setIcon(self, column, icon, color = None):
     """
     Set the icon to be displayed in the given column.
     
     :type column: int or str
     :type icon: QtGui.QIcon
     :rtype: None
     """
     if isinstance(icon, basestring):
         if not os.path.exists(icon):
             color = color or studioqt.Color(255, 255, 255, 20)
             icon = studioqt.resource().icon('image', color=color)
         else:
             icon = QtGui.QIcon(icon)
     if isinstance(column, basestring):
         self._icon[column] = icon
     else:
         self._pixmap[column] = None
         QtWidgets.QTreeWidgetItem.setIcon(self, column, icon)
Esempio n. 15
0
 def setError(self, text, msec = DISPLAY_TIME):
     icon = studioqt.resource().icon('error')
     self._button.setIcon(icon)
     self._button.show()
     self._label.setStyleSheet('color: rgb(222, 0, 0);background-color: rgb(0, 0, 0, 0);')
     self.setText(text, msec)
Esempio n. 16
0
 def setWarning(self, text, msec = DISPLAY_TIME):
     icon = studioqt.resource().icon('warning')
     self._button.setIcon(icon)
     self._button.show()
     self._label.setStyleSheet('color: rgb(222, 180, 0);background-color: rgb(0, 0, 0, 0);')
     self.setText(text, msec)
Esempio n. 17
0
 def setInfo(self, text, msec = DISPLAY_TIME):
     icon = studioqt.resource().icon('info')
     self._button.setIcon(icon)
     self._button.show()
     self._label.setStyleSheet('background-color: rgb(0, 0, 0, 0);')
     self.setText(text, msec)