diff --git a/piker/ui/_editors.py b/piker/ui/_editors.py index b065fef4..87e6b36d 100644 --- a/piker/ui/_editors.py +++ b/piker/ui/_editors.py @@ -141,7 +141,7 @@ class LineEditor(Struct): except KeyError: # when the current cursor doesn't have said line # registered (probably means that user held order mode - # key while panning to another vieww) then we just + # key while panning to another view) then we just # ignore the remove error. pass line.delete() diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 9b7eba6d..b9ac32ea 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -217,8 +217,17 @@ async def handle_viewmode_kb_inputs( if order_keys_pressed: - # show the pp size label - order_mode.current_pp.nav.show() + # TODO: it seems like maybe the composition should be + # reversed here? Like, maybe we should have the nav have + # access to the pos state and then make encapsulated logic + # that shows the right stuff on screen instead or order mode + # and position-related abstractions doing this? + + # show the pp size label only if there is + # a non-zero pos existing + tracker = order_mode.current_pp + if tracker.live_pp.size: + tracker.nav.show() # TODO: show pp config mini-params in status bar widget # mode.pp_config.show() @@ -259,8 +268,8 @@ async def handle_viewmode_kb_inputs( Qt.Key_S in pressed or order_keys_pressed or Qt.Key_O in pressed - ) and - key in NUMBER_LINE + ) + and key in NUMBER_LINE ): # hot key to set order slots size. # change edit field to current number line value,