Hide labels, show markers for lines on slow chart

history_view
Tyler Goodlet 2022-09-13 18:31:21 -04:00
parent df42e7acc4
commit b7e60b9653
1 changed files with 13 additions and 4 deletions

View File

@ -235,11 +235,15 @@ class OrderMode:
) -> list[LevelLine]: ) -> list[LevelLine]:
lines: list[LevelLine] = [] lines: list[LevelLine] = []
for chart in [self.chart, self.hist_chart]: for chart, kwargs in [
(self.chart, {}),
(self.hist_chart, {'only_show_markers_on_hover': False}),
]:
kwargs.update(line_kwargs)
line = self.line_from_order( line = self.line_from_order(
order=order, order=order,
chart=chart, chart=chart,
**line_kwargs, **kwargs,
) )
lines.append(line) lines.append(line)
@ -350,7 +354,6 @@ class OrderMode:
lines = self.lines_from_order( lines = self.lines_from_order(
order, order,
show_markers=True, show_markers=True,
only_show_markers_on_hover=True,
) )
# register the "submitted" line under the cursor # register the "submitted" line under the cursor
# to be displayed when above order ack arrives # to be displayed when above order ack arrives
@ -457,6 +460,11 @@ class OrderMode:
dialog.lines = lines dialog.lines = lines
dialog.last_status_close() dialog.last_status_close()
for line in lines:
# hide any lines not currently moused-over
if not line.get_cursor():
line.hide_labels()
return dialog return dialog
def on_fill( def on_fill(
@ -561,7 +569,8 @@ class OrderMode:
) )
def cancel_all_orders(self) -> list[str]: def cancel_all_orders(self) -> list[str]:
'''Cancel all orders for the current chart. '''
Cancel all orders for the current chart.
''' '''
return self.cancel_orders_from_lines( return self.cancel_orders_from_lines(