glyphLineView.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:defconQt 作者: trufont 项目源码 文件源码
def drawGlyphBackground(self, painter, glyph, rect, selected=False):
        if glyph.name == ".notdef":
            painter.fillRect(QRectF(*rect), self._notdefBackgroundColor)
        if selected:
            if self._glyphSelectionColor is not None:
                selectionColor = self._glyphSelectionColor
            else:
                palette = self.palette()
                active = palette.currentColorGroup() != QPalette.Inactive
                opacityMultiplier = platformSpecific.colorOpacityMultiplier()
                selectionColor = palette.color(QPalette.Highlight)
                selectionColor.setAlphaF(
                    .2 * opacityMultiplier if active else .9)
            xMin, yMin, width, height = rect
            painter.save()
            if self._drawMetrics:
                pen = painter.pen()
                pen.setStyle(Qt.DotLine)
                pen.setColor(self._metricsColor)
                painter.setPen(pen)
                drawing.drawLine(painter, xMin, yMin, xMin, yMin + height)
                drawing.drawLine(
                    painter, xMin + width, yMin, xMin + width, yMin + height)
            painter.fillRect(xMin, yMin, width, -26, selectionColor)
            painter.restore()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号