From 4f9827c070a5b2cd1362ba581af852fae1c18817 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 12 Sep 2021 19:36:14 -0400 Subject: [PATCH] Try out account icons from order mode --- piker/ui/order_mode.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index 40f8a3a3..d8b862a3 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -549,9 +549,6 @@ async def open_order_mode( lines = LineEditor(chart=chart) arrows = ArrowEditor(chart, {}) - # allocation and account settings side pane - form = chart.sidepane - # symbol id symbol = chart.linked.symbol symkey = symbol.key @@ -645,7 +642,9 @@ async def open_order_mode( pp_tracker.hide() trackers[account_name] = pp_tracker - # order pane widgets and allocation model + # setup order mode sidepane widgets + form = chart.sidepane + order_pane = SettingsPane( form=form, # XXX: ugh, so hideous... @@ -654,6 +653,17 @@ async def open_order_mode( step_label=form.bottom_label, limit_label=form.top_label, ) + # set all entries as unavailable at startup and then fill out + # positions and ready icons + # order_pane.update_accounts_icon('unavailable') + + for name, tracker in trackers.items(): + if tracker.live_pp.size > 0: + order_pane.update_accounts_icon('long_pp', [name]) + elif tracker.live_pp.size < 0: + order_pane.update_accounts_icon('short_pp', [name]) + # else: + # order_pane.update_accounts_icon('ready', [name]) # top level abstraction which wraps all this crazyness into # a namespace..