From aec8f1d25c48c612c6b6849de7976f668e784467 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 11 Feb 2021 23:41:40 -0500 Subject: [PATCH] Hide y-label on level line mouse over --- piker/ui/_graphics/_curve.py | 1 + piker/ui/_graphics/_lines.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/piker/ui/_graphics/_curve.py b/piker/ui/_graphics/_curve.py index a9b24e7f..4feb5d37 100644 --- a/piker/ui/_graphics/_curve.py +++ b/piker/ui/_graphics/_curve.py @@ -141,6 +141,7 @@ class FastAppendCurve(pg.PlotCurveItem): w = hb_size.width() + 1 h = hb_size.height() + 1 + br = QtCore.QRectF( # top left diff --git a/piker/ui/_graphics/_lines.py b/piker/ui/_graphics/_lines.py index 7bf5b4ba..c89021b6 100644 --- a/piker/ui/_graphics/_lines.py +++ b/piker/ui/_graphics/_lines.py @@ -490,6 +490,7 @@ class LevelLine(pg.InfiniteLine): cur = chart._cursor cur.add_hovered(self) cur.graphics[chart]['yl'].hide() + cur.graphics[chart]['hl'].hide() for at, label in self._labels: label.show() @@ -504,7 +505,10 @@ class LevelLine(pg.InfiniteLine): cur = chart._cursor cur._hovered.remove(self) - cur.graphics[chart]['yl'].show() + if self not in cur._trackers: + g = cur.graphics[chart] + g['yl'].show() + g['hl'].show() if not self._always_show_labels: for at, label in self._labels: @@ -519,7 +523,9 @@ class LevelLine(pg.InfiniteLine): chart = self._chart # hide y-crosshair - chart._cursor.graphics[chart]['hl'].hide() + graphics = chart._cursor.graphics[chart] + graphics['hl'].hide() + graphics['yl'].hide() # highlight self.currentPen = self.hoverPen @@ -534,7 +540,8 @@ class LevelLine(pg.InfiniteLine): # This is the final position in the drag if ev.isFinish(): # show y-crosshair again - chart._cursor.graphics[chart]['hl'].show() + graphics['hl'].show() + graphics['yl'].show() def delete(self) -> None: """Remove this line from containing chart/view/scene.