示例#1
0
 def __init__(self, parent=None):
     super(XDockToolbar, self).__init__(parent)
     
     # defines the position for this widget
     self._currentAction = -1
     self._selectedAction = None
     self._padding = 8
     self._position = XDockToolbar.Position.South
     self._minimumPixmapSize = QSize(16, 16)
     self._maximumPixmapSize = QSize(48, 48)
     self._hoverTimer = QTimer(self)
     self._hoverTimer.setSingleShot(True)
     self._hoverTimer.setInterval(1000)
     self._actionHeld = False
     self._easingCurve = QEasingCurve(QEasingCurve.InOutQuad)
     self._duration = 200
     self._animating = False
     
     # install an event filter to update the location for this toolbar
     layout = QBoxLayout(QBoxLayout.LeftToRight)
     layout.setContentsMargins(2, 2, 2, 2)
     layout.setSpacing(0)
     layout.addStretch(1)
     layout.addStretch(1)
     
     self.setLayout(layout)
     self.setContentsMargins(2, 2, 2, 2)
     self.setMouseTracking(True)
     parent.window().installEventFilter(self)
     parent.window().statusBar().installEventFilter(self)
     
     self._hoverTimer.timeout.connect(self.emitActionHovered)
 def __init__( self, parent = None ):
     super(XActionGroupWidget, self).__init__( parent )
     
     # define custom properties
     self._actionGroup   = None
     self._padding       = 5
     self._cornerRadius  = 10
     
     # set default properties
     layout = QBoxLayout(QBoxLayout.LeftToRight)
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(0)
     self.setSizePolicy( QSizePolicy.Preferred, QSizePolicy.Preferred )
     self.setLayout(layout)
示例#3
0
    def __init__(self, parent=None):
        super(XSplitButton, self).__init__(parent)

        # define custom properties
        self._actionGroup = QActionGroup(self)
        self._padding = 5
        self._cornerRadius = 10
        self._checkable = True

        # set default properties
        layout = QBoxLayout(QBoxLayout.LeftToRight)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        self.setLayout(layout)
        self.clear()

        # create connections
        self._actionGroup.hovered.connect(self.emitHovered)
        self._actionGroup.triggered.connect(self.emitTriggered)
示例#4
0
 def __init__( self, parent = None ):
     super(XSplitButton, self).__init__( parent )
     
     # define custom properties
     self._actionGroup   = QActionGroup(self)
     self._padding       = 5
     self._cornerRadius  = 10
     self._checkable     = True
     
     # set default properties
     layout = QBoxLayout(QBoxLayout.LeftToRight)
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(0)
     self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
     self.setLayout(layout)
     self.clear()
     
     # create connections
     self._actionGroup.hovered.connect(self.emitHovered)
     self._actionGroup.triggered.connect(self.emitTriggered)