Paints the background for the dock toolbar.
        
        :param      event | <QPaintEvent>
193879
def paintEvent(self, event):
        
        x = 1
        y = 1
        w = self.width()
        h = self.height()
        
        clr_a = QColor(220, 220, 220)
        clr_b = QColor(190, 190, 190)
        
        grad = QLinearGradient()
        grad.setColorAt(0.0, clr_a)
        grad.setColorAt(0.6, clr_a)
        grad.setColorAt(1.0, clr_b)
        
        # adjust the coloring for the horizontal toolbar
        if self.position() & (self.Position.North | self.Position.South):
            h = self.minimumPixmapSize().height() + 6
            
            if self.position() == self.Position.South:
                y = self.height() - h
                grad.setStart(0, y)
                grad.setFinalStop(0, self.height())
            else:
                grad.setStart(0, 0)
                grad.setFinalStart(0, h)
        
        # adjust the coloring for the vertical toolbar
        if self.position() & (self.Position.East | self.Position.West):
            w = self.minimumPixmapSize().width() + 6
            
            if self.position() == self.Position.West:
                x = self.width() - w
                grad.setStart(x, 0)
                grad.setFinalStop(self.width(), 0)
            else:
                grad.setStart(0, 0)
                grad.setFinalStop(w, 0)
        
        with XPainter(self) as painter:
            painter.fillRect(x, y, w, h, grad)
            
            # show the active action
            action = self.selectedAction()
            if action is not None and \
               not self.currentAction() and \
               not self._animating:
                for lbl in self.actionLabels():
                    if lbl.action() != action:
                        continue
                    
                    geom = lbl.geometry()
                    size = lbl.pixmapSize()
                    
                    if self.position() == self.Position.North:
                        x = geom.left()
                        y = 0
                        w = geom.width()
                        h = size.height() + geom.top() + 2
                    
                    elif self.position() == self.Position.East:
                        x = 0
                        y = geom.top()
                        w = size.width() + geom.left() + 2
                        h = geom.height()
                    
                    painter.setPen(QColor(140, 140, 40))
                    painter.setBrush(QColor(160, 160, 160))
                    painter.drawRect(x, y, w, h)
                    break
1165960
def contextMenuEvent(self, event):
        
        if self.contextMenuPolicy() == Qt.DefaultContextMenu:
            self.showMenu(event.pos())
        else:
            super(XOrbTreeWidget, self).contextMenuEvent(event)
35918
def drawBackground( self, painter, opt, rect, brush ):
        
        if not brush:
            return
        
        painter.setPen(QtCore.Qt.NoPen)
        painter.setBrush(brush)
        painter.drawRect(rect)
1233003
private void paintBackgroundApart(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createScrollButtonApart(0, 0, width, height);

        dropShadow.fill(g, s);
        fillScrollBarButtonInteriorColors(g, s, isIncrease, buttonsTogether);
    }
1061400
def paintEvent(self, e):
        
        self._update_visible_blocks(e)
        super(CodeEdit, self).paintEvent(e)
        self.painted.emit(e)
1339982
def mouseReleaseEvent(self, event):
        
        self.declaration.mouse_release_event(event)
        super(QtGraphicsView, self).mouseReleaseEvent(event)
402779
def paintEvent( self, event ):
        
        super(XMenu, self).paintEvent(event)
        
        if self.showTitle():
            with XPainter(self) as painter:
                palette = self.palette()
                
                painter.setBrush(palette.color(palette.Button))
                painter.setPen(Qt.NoPen)
                painter.drawRect(1, 1, self.width() - 2, 22)
                
                painter.setBrush(Qt.NoBrush)
                painter.setPen(palette.color(palette.ButtonText))
                painter.drawText(1, 1, self.width() - 2, 22, 
                                 Qt.AlignCenter, self.title())
914287
def mousePressEvent( self, event ):
        
        XPopupWidget.hideToolTip()
        
        # update the current date
        self.setCurrentDate(self.dateAt(event.scenePos()))
        
        super(XCalendarScene, self).mousePressEvent(event)
424808
public void setBackgroundPaint(final Paint PAINT) {
        if (null == backgroundPaint) {
            _backgroundPaint = PAINT;
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            backgroundPaint.set(PAINT);
        }
    }
535114
def showEvent(self, event):
        
        super(XOverlayWidget, self).showEvent(event)

        # raise to the top
        self.raise_()
        self._closeButton.setVisible(self.isClosable())

        widget = self.centralWidget()
        if widget:
            center = self.rect().center()
            start_x = end_x = center.x() - widget.width() / 2
            start_y = -widget.height()
            end_y = center.y() - widget.height() / 2

            start = QtCore.QPoint(start_x, start_y)
            end = QtCore.QPoint(end_x,  end_y)

            # create the movement animation
            anim = QtCore.QPropertyAnimation(self)
            anim.setPropertyName('pos')
            anim.setTargetObject(widget)
            anim.setStartValue(start)
            anim.setEndValue(end)
            anim.setDuration(500)
            anim.setEasingCurve(QtCore.QEasingCurve.InOutQuad)
            anim.finished.connect(anim.deleteLater)
            anim.start()
735125
def enterEvent(self, event):
        
        super(XViewPanelItem, self).enterEvent(event)

        # store the hover state and mark for a repaint
        self._hovered = True
        self.update()
621454
private void paintBackgroundTogetherIncrease(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createScrollButtonTogetherIncrease(0, 0, width, height);

        dropShadow.fill(g, s);
        fillScrollBarButtonInteriorColors(g, s, isIncrease, buttonsTogether);
    }
822280
def _paint_margin(self, event):
        
        font = QtGui.QFont(self.editor.font_name, self.editor.font_size +
                           self.editor.zoom_level)
        metrics = QtGui.QFontMetricsF(font)
        pos = self._margin_pos
        offset = self.editor.contentOffset().x() + \
            self.editor.document().documentMargin()
        x80 = round(metrics.width(' ') * pos) + offset
        painter = QtGui.QPainter(self.editor.viewport())
        painter.setPen(self._pen)
        painter.drawLine(x80, 0, x80, 2 ** 16)
168198
def paintEvent(self, event):
        """"""
        painter = QPainter(self)
        size = self.size()

        color = QColor(self.color)
        color.setAlphaF(.5)
        painter.setPen(color)

        for column in self.columns:
            x = self.editor.fontMetrics().width(column * '9')
            painter.drawLine(x, 0, x, size.height())
1223731
private void paintBackgroundHover(Graphics2D g, JComponent c, int width, int height) {
        paintBackground(g, c, width, height, hover);
    }
569544
def paintEvent(self, event):
        """"""
        painter = QPainter(self)

        color = QColor(self.color)
        color.setAlphaF(.5)
        painter.setPen(color)
        offset = self.editor.document().documentMargin() + \
            self.editor.contentOffset().x()

        for _, line_number, block in self.editor.visible_blocks:

            indentation = TextBlockHelper.get_fold_lvl(block)
            ref_lvl = indentation
            block = block.next()
            last_line = block.blockNumber()
            lvl = TextBlockHelper.get_fold_lvl(block)
            if ref_lvl == lvl:  # for zone set programmatically such as imports
                # in pyqode.python
                ref_lvl -= 1

            while (block.isValid() and
                   TextBlockHelper.get_fold_lvl(block) > ref_lvl):
                last_line = block.blockNumber()
                block = block.next()

            end_of_sub_fold = block
            if last_line:
                block = block.document().findBlockByNumber(last_line)
                while ((block.blockNumber()) and (block.text().strip() == ''
                       or block.text().strip().startswith('#'))):
                    block = block.previous()
                    last_line = block.blockNumber()

            block = self.editor.document().findBlockByNumber(line_number)
            top = int(self.editor.blockBoundingGeometry(block).translated(
                self.editor.contentOffset()).top())
            bottom = top + int(self.editor.blockBoundingRect(block).height())

            indentation = TextBlockHelper.get_fold_lvl(block)

            for i in range(1, indentation):
                if (line_number > last_line and
                        TextBlockHelper.get_fold_lvl(end_of_sub_fold) <= i):
                    continue
                else:
                    x = self.editor.fontMetrics().width(i * self.i_width *
                                                        '9') + offset
                    painter.drawLine(x, top, x, bottom)
106986
private void paintBackgroundTogetherDecrease(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createScrollButtonTogetherDecrease(0, 0, width, height);

        dropShadow.fill(g, s);
        fillScrollBarButtonInteriorColors(g, s, isIncrease, buttonsTogether);
    }