Drop old pp config widget inserts; use new pane layout func

fsp_feeds
Tyler Goodlet 2021-07-30 14:23:46 -04:00
parent 3e237124ec
commit 1fc9047746
1 changed files with 10 additions and 22 deletions

View File

@ -76,7 +76,7 @@ from ..data import feed
from ._forms import ( from ._forms import (
FieldsForm, FieldsForm,
open_form, open_form,
mk_health_bar, mk_order_pane_layout,
) )
@ -240,6 +240,7 @@ class GodWidget(QWidget):
# self.vbox.addWidget(linkedsplits) # self.vbox.addWidget(linkedsplits)
linkedsplits.show() linkedsplits.show()
linkedsplits.focus() linkedsplits.focus()
self.linkedsplits = linkedsplits self.linkedsplits = linkedsplits
symbol = linkedsplits.symbol symbol = linkedsplits.symbol
@ -331,8 +332,9 @@ class LinkedSplits(QWidget):
def focus(self) -> None: def focus(self) -> None:
if self.chart is not None: if self.chart is not None:
print("FOCUSSING CHART")
self.chart.focus() self.chart.focus()
self.chart.parent().show() # self.chart.parent().show()
def unfocus(self) -> None: def unfocus(self) -> None:
if self.chart is not None: if self.chart is not None:
@ -638,7 +640,6 @@ class ChartPlotWidget(pg.PlotWidget):
return self._vb return self._vb
def focus(self) -> None: def focus(self) -> None:
# self.setFocus()
self._vb.setFocus() self._vb.setFocus()
def last_bar_in_view(self) -> int: def last_bar_in_view(self) -> int:
@ -1375,7 +1376,7 @@ async def run_fsp(
open_form( open_form(
godwidget=linkedsplits.godwidget, godwidget=linkedsplits.godwidget,
parent=linkedsplits.godwidget, parent=linkedsplits.godwidget,
fields={ fields_schema={
'name': { 'name': {
'key': '**fsp**:', 'key': '**fsp**:',
'type': 'select', 'type': 'select',
@ -1814,10 +1815,12 @@ async def _async_main(
async with ( async with (
trio.open_nursery() as root_n, trio.open_nursery() as root_n,
# fields form to configure order entry
open_form( open_form(
godwidget=godwidget, godwidget=godwidget,
parent=godwidget, parent=godwidget,
fields={ fields_schema={
'account': { 'account': {
'key': '**account**:', 'key': '**account**:',
'type': 'select', 'type': 'select',
@ -1837,7 +1840,7 @@ async def _async_main(
], ],
}, },
'disti_policy': { 'disti_policy': {
'key': '**policy**:', 'key': '**weight**:',
'type': 'select', 'type': 'select',
'default_value': ['uniform'], 'default_value': ['uniform'],
}, },
@ -1855,27 +1858,12 @@ async def _async_main(
) as pp_config, ) as pp_config,
): ):
pp_config: FieldsForm pp_config: FieldsForm
mk_health_bar(pp_config) mk_order_pane_layout(pp_config)
pp_config.show() pp_config.show()
# add as next-to-y-axis pane # add as next-to-y-axis pane
godwidget.pp_config = pp_config godwidget.pp_config = pp_config
# XXX: code for adding to god widget directly
# godwidget.hbox.insertWidget(
# 1,
# pp_config,
# # alights to top and uses minmial space based on
# # search bar size hint (i think?)
# alignment=Qt.AlignTop
# )
# XXX: code for adding to status bar
# sb = god_widget.window.statusBar()
# sb.insertPermanentWidget(0, pp_config)
# pp_config.show()
# set root nursery and task stack for spawning other charts/feeds # set root nursery and task stack for spawning other charts/feeds
# that run cached in the bg # that run cached in the bg
godwidget._root_n = root_n godwidget._root_n = root_n