Exemple #1
0
 def __init__(self, text_options, ui_key, parent=None):
     UIWidget.__init__(self, ui_key=ui_key)
     PanelButton.__init__(self, None, text_options[0], size=24, parent=parent)
     self.setCheckable(True)
     self.text_options = text_options
     font = QtGui.QFont(qt_prefs.fonts[g.UI_FONT])
     font.setPointSize(font.pointSize() * 1.2)
     fm = QtGui.QFontMetrics(font)
     mw = max([fm.width(text) for text in text_options])
     self.setFlat(True)
     self.setMinimumWidth(mw + 12)
     self.setMinimumHeight(24)
     ctrl.add_watcher(self, 'ui_font_changed')
Exemple #2
0
 def __init__(self, text_options, ui_key, parent=None, icon=None):
     UIWidget.__init__(self, ui_key=ui_key)
     self.negated_icon = None
     PanelButton.__init__(self,
                          icon,
                          text_options[0],
                          size=24,
                          parent=parent)
     self.setCheckable(True)
     self.text_options = text_options
     font = QtGui.QFont(qt_prefs.fonts[g.UI_FONT])
     font.setPointSize(font.pointSize() * 1.2)
     fm = QtGui.QFontMetrics(font)
     mw = max([fm.width(text) for text in text_options])
     self.setFlat(True)
     self.setMinimumWidth(mw + 12)
     self.setMinimumHeight(24)
     ctrl.add_watcher(self, 'ui_font_changed')
Exemple #3
0
 def __init__(self, key, tt):
     self.checked_icon = None
     self.hover_icon = None
     PanelButton.__init__(self, qt_prefs.eye_icon, size=24, tooltip=tt)
     self._hover = False
     self.setCheckable(True)