Add an all order lines getter method

asyncify_input_modes
Tyler Goodlet 2021-06-17 17:00:10 -04:00
parent 0133f0b589
commit 572f984d06
1 changed files with 6 additions and 6 deletions

View File

@ -95,12 +95,9 @@ _order_lines: dict[str, LevelLine] = {}
@dataclass @dataclass
class LineEditor: class LineEditor:
"""The great editor of linez.. '''The great editor of linez.
"""
# TODO: drop this?
# view: 'ChartView'
'''
_order_lines: field(default_factory=_order_lines) _order_lines: field(default_factory=_order_lines)
chart: 'ChartPlotWidget' = None # type: ignore # noqa chart: 'ChartPlotWidget' = None # type: ignore # noqa
_active_staged_line: LevelLine = None _active_staged_line: LevelLine = None
@ -259,13 +256,16 @@ class LineEditor:
return line return line
def lines_under_cursor(self): def lines_under_cursor(self) -> list[LevelLine]:
"""Get the line(s) under the cursor position. """Get the line(s) under the cursor position.
""" """
# Delete any hoverable under the cursor # Delete any hoverable under the cursor
return self.chart._cursor._hovered return self.chart._cursor._hovered
def all_lines(self) -> tuple[LevelLine]:
return tuple(self._order_lines.values())
def remove_line( def remove_line(
self, self,
line: LevelLine = None, line: LevelLine = None,