From 6b93eedcda6bba83ac9bd9ec5fec0eb32f57e4a5 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 7 Sep 2022 15:55:23 -0400 Subject: [PATCH] Port to new `._position.Nav` apis in order mode --- piker/ui/_interaction.py | 4 ++-- piker/ui/order_mode.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 6ec79682..ee2053c2 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -217,7 +217,7 @@ async def handle_viewmode_kb_inputs( if order_keys_pressed: # show the pp size label - order_mode.current_pp.show() + order_mode.current_pp.nav.show() # TODO: show pp config mini-params in status bar widget # mode.pp_config.show() @@ -277,7 +277,7 @@ async def handle_viewmode_kb_inputs( else: # none active # hide pp label - order_mode.current_pp.hide_info() + order_mode.current_pp.nav.hide_info() # if none are pressed, remove "staged" level # line under cursor position diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index 1c78951a..b97619f3 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -733,11 +733,11 @@ async def open_order_mode( ) pp_tracker = PositionTracker( - chart, + [chart, hist_chart], alloc, startup_pp ) - pp_tracker.hide() + pp_tracker.nav.hide() trackers[account_name] = pp_tracker assert pp_tracker.startup_pp.size == pp_tracker.live_pp.size @@ -749,8 +749,8 @@ async def open_order_mode( # on existing position, show pp tracking graphics if pp_tracker.startup_pp.size != 0: - pp_tracker.show() - pp_tracker.hide_info() + pp_tracker.nav.show() + pp_tracker.nav.hide_info() # setup order mode sidepane widgets form: FieldsForm = chart.sidepane @@ -810,8 +810,8 @@ async def open_order_mode( # select a pp to track tracker: PositionTracker = trackers[pp_account] mode.current_pp = tracker - tracker.show() - tracker.hide_info() + tracker.nav.show() + tracker.nav.hide_info() # XXX: would love to not have to do this separate from edit # fields (which are done in an async loop - see below)