From 9c07db368d4dcee64aa8495b6f47f3bc8c932904 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 24 Jul 2021 16:07:04 -0400 Subject: [PATCH] Use mode name setter throughout --- piker/ui/_chart.py | 2 +- piker/ui/_interaction.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index d23e93b8..a162d76a 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -456,7 +456,7 @@ class ChartPlotWidget(pg.PlotWidget): _l1_labels: L1Labels = None - mode_name: str = 'mode: view' + mode_name: str = 'view' # TODO: can take a ``background`` color setting - maybe there's # a better one? diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 267fa699..4e5f8017 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -206,8 +206,7 @@ async def handle_viewmode_inputs( view.mode.set_exec(action) prefix = trigger_mode + '-' if action != 'alert' else '' - view._chart.window().mode_label.setText( - f'mode: {prefix}{action}') + view._chart.window().set_mode_name(f'{prefix}{action}') else: # none active @@ -221,7 +220,7 @@ async def handle_viewmode_inputs( if view.hasFocus(): # update mode label - view._chart.window().mode_label.setText('mode: view') + view._chart.window().set_mode_name('view') view.order_mode = False @@ -239,7 +238,7 @@ class ChartView(ViewBox): - zoom on right-click-n-drag to cursor position ''' - mode_name: str = 'mode: view' + mode_name: str = 'view' def __init__( self,