Exemple #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)
Exemple #2
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)
 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)
Exemple #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)
Exemple #5
0
    def __init__(self, orientation, parent):
        super(XSplitterHandle, self).__init__(orientation, parent)

        # create a layout for the different buttons
        self._collapsed = False
        self._storedSizes = None

        self._collapseBefore = QToolButton(self)
        self._resizeGrip = QLabel(self)
        self._collapseAfter = QToolButton(self)

        self._collapseBefore.setAutoRaise(True)
        self._collapseAfter.setAutoRaise(True)

        self._collapseBefore.setCursor(Qt.ArrowCursor)
        self._collapseAfter.setCursor(Qt.ArrowCursor)

        # define the layout
        layout = QBoxLayout(QBoxLayout.LeftToRight, self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addStretch(1)
        layout.addWidget(self._collapseBefore)
        layout.addWidget(self._resizeGrip)
        layout.addWidget(self._collapseAfter)
        layout.addStretch(1)
        self.setLayout(layout)

        # set the orientation to start with
        self.setOrientation(orientation)

        # create connections
        self._collapseAfter.clicked.connect(self.toggleCollapseAfter)
        self._collapseBefore.clicked.connect(self.toggleCollapseBefore)
Exemple #6
0
 def __init__( self, orientation, parent ):
     super(XSplitterHandle, self).__init__( orientation, parent )
     
     # create a layout for the different buttons
     self._collapsed      = False
     self._storedSizes    = None
     
     self._collapseBefore = QToolButton(self)
     self._resizeGrip     = QLabel(self)
     self._collapseAfter  = QToolButton(self)
     
     self._collapseBefore.setAutoRaise(True)
     self._collapseAfter.setAutoRaise(True)
     
     self._collapseBefore.setCursor(Qt.ArrowCursor)
     self._collapseAfter.setCursor(Qt.ArrowCursor)
     
     # define the layout
     layout = QBoxLayout(QBoxLayout.LeftToRight, self)
     layout.setContentsMargins(0, 0, 0, 0)
     layout.addStretch(1)
     layout.addWidget(self._collapseBefore)
     layout.addWidget(self._resizeGrip)
     layout.addWidget(self._collapseAfter)
     layout.addStretch(1)
     self.setLayout(layout)
     
     # set the orientation to start with
     self.setOrientation(orientation)
     
     # create connections
     self._collapseAfter.clicked.connect(  self.toggleCollapseAfter )
     self._collapseBefore.clicked.connect( self.toggleCollapseBefore )