def __init__(self,
                 icon,
                 title,
                 parent,
                 size=None,
                 padding=None,
                 color=None,
                 hover_color=None):
        QPushButton.__init__(self, parent)
        self._theme_manager = ThemeManager.get(self)
        self._background_color = hover_color or self._theme_manager.get_color(
            'button_background_hover')
        self.setToolTip(title)
        self._icon = Icon(self, icon, size, padding, color)
        self._iconname = icon

        self._layout = QHBoxLayout(self)
        self._layout.addWidget(self._icon)
        self._layout.setContentsMargins(0, 0, 0, 0)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self._size = size
        self.setFlat(True)
        self._background_opacity = 0.0
        self._background_opacity_stop = 0.0
        self._update_style_sheet()
        self._animation = QPropertyAnimation(self, b'backgroundOpacity')
        self.clicked.connect(self._update_background_opacity_stop)
Beispiel #2
0
 def __init__(self, data, name, text, parent):
     QPushButton.__init__(self, text, parent)
     self.ic = QPixmap(self.iconSize())
     color = data[name]
     self.data, self.name = data, name
     if color is not None:
         self.current_color = read_color(color).color()
         self.ic.fill(self.current_color)
     else:
         self.ic.fill(Qt.transparent)
         self.current_color = color
     self.update_tooltip()
     self.setIcon(QIcon(self.ic))
     self.clicked.connect(self.choose_color)
Beispiel #3
0
 def __init__(self, initial_color=None, parent=None, choose_text=None):
     QPushButton.__init__(self, parent)
     self._color = None
     self.choose_text = choose_text or _('Choose &color')
     self.color = initial_color
     self.clicked.connect(self.choose_color)
Beispiel #4
0
 def __init__(self, text=None):
     QPushButton.__init__(self, text)
Beispiel #5
0
 def __init__(self, text, action, parent):
     QPushButton.__init__(self, text, parent)
     self.clicked.connect(lambda : parent.search_triggered.emit(action))
Beispiel #6
0
 def __init__(self, text=None):
     QPushButton.__init__(self, text)
Beispiel #7
0
 def __init__(self, *args, **kwargs):
     QPushButton.__init__(self, *args, **kwargs)
     self.timer = t = QTimer(self)
     t.setSingleShot(True), t.timeout.connect(self.animate_done)
Beispiel #8
0
 def __init__(self, initial_color=None, parent=None, choose_text=None):
     QPushButton.__init__(self, parent)
     self._color = None
     self.choose_text = choose_text or _('Choose &color')
     self.color = initial_color
     self.clicked.connect(self.choose_color)
Beispiel #9
0
 def __init__(self, text, action, parent):
     QPushButton.__init__(self, text, parent)
     self.clicked.connect(lambda: parent.search_triggered.emit(action))
Beispiel #10
0
 def __init__(self, *args, **kwargs):
     QPushButton.__init__(self, *args, **kwargs)
     self.timer = t = QTimer(self)
     t.setSingleShot(True), t.timeout.connect(self.animate_done)