def __init__(self, parent): QLabel.__init__(self, parent) self.setFocusPolicy(Qt.FocusPolicy.NoFocus) if QApplication.instance().is_dark_theme: c = builtin_colors_dark['green'] else: c = builtin_colors_light['green'] self.color = self.palette().color(QPalette.ColorRole.WindowText).name() bg = QColor(c).getRgb() self.setStyleSheet(f'''QLabel {{ background-color: rgba({bg[0]}, {bg[1]}, {bg[2]}, 0.85); border-radius: 4px; color: {self.color}; padding: 0.5em; }}''' ) self.linkActivated.connect(self.link_activated) self.close_timer = t = QTimer() t.setSingleShot(True) t.timeout.connect(self.hide) self.setMouseTracking(True) self.hide()
def __init__(self, parent): QLabel.__init__(self, parent) self.mouse_over = False self.setCursor(Qt.CursorShape.PointingHandCursor) self.setToolTip(_('See what\'s new in this calibre release'))
def __init__(self, *args, **kwargs): QLabel.__init__(self, *args, **kwargs) self.setCursor(Qt.CursorShape.PointingHandCursor)
def __init__(self, parent=None): QLabel.__init__(self, parent) self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum)
def __init__(self, parent=None): QLabel.__init__(self, parent) self.setMinimumWidth(400) self.base_msg = '<h3>' + _('Choose a font family') + '</h3>' self.setText(self.base_msg) self.setWordWrap(True)