From 1e491fb1bbf2ac76e678165929822997b312dd6d Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 5 Nov 2020 13:23:29 -0500 Subject: [PATCH] Use pyqtgraph default pen for level lines --- piker/ui/_graphics.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/piker/ui/_graphics.py b/piker/ui/_graphics.py index f2172c6d..f881e136 100644 --- a/piker/ui/_graphics.py +++ b/piker/ui/_graphics.py @@ -650,6 +650,8 @@ class BarItems(pg.GraphicsObject): class LevelLabel(YSticky): + line_pen = pg.mkPen(hcolor('bracket')) + _w_margin = 4 _h_margin = 3 level: float = 0 @@ -716,10 +718,15 @@ class LevelLabel(YSticky): p: QtGui.QPainter, rect: QtCore.QRectF ) -> None: + p.setPen(self.line_pen) + if self._orient_v == 'bottom': - p.drawLine(rect.topLeft(), rect.topRight()) + lp, rp = rect.topLeft(), rect.topRight() + # p.drawLine(rect.topLeft(), rect.topRight()) elif self._orient_v == 'top': - p.drawLine(rect.bottomLeft(), rect.bottomRight()) + lp, rp = rect.bottomLeft(), rect.bottomRight() + + p.drawLine(lp.x(), lp.y(), rp.x(), rp.y()) class L1Label(LevelLabel):