Use pyqtgraph default pen for level lines

bar_select
Tyler Goodlet 2020-11-05 13:23:29 -05:00
parent cc88300ac5
commit 1e491fb1bb
1 changed files with 9 additions and 2 deletions

View File

@ -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):