From 5a0612e6a8f408d49bebdeb8763d1af7006172f0 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 26 Jan 2021 13:34:29 -0500 Subject: [PATCH] Factor some line and label steps --- piker/ui/_interaction.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 1a15c2a6..0079c371 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -253,6 +253,9 @@ class LineEditor: dotted=dotted, size=size, ) + line.label._use_extra_fields = size is not None + + # cache staging line after creation self._stage_line = line else: @@ -271,17 +274,13 @@ class LineEditor: line._dotted = dotted line.color = color line.setMouseHover(hl_on_hover) - - # XXX: must have this to trigger updated - # label contents rendering - line.setPos(y) - line.set_level() - - line.update() line.show() - label.show() - # label.set_label_str(line.) + # XXX: must have this to trigger updated + # label contents rendering + line.setPos(y) + line.set_level() + label.show() self._active_staged_line = line