From c7881399cfed7f93100eaea58d1cc9914fe7d3d8 Mon Sep 17 00:00:00 2001
From: kienle <kienle@passcal.nmt.edu>
Date: Fri, 21 Apr 2023 16:25:18 -0600
Subject: [PATCH] Remove ruler texts in all plot on ESC pressed

---
 .../view/plotting/plotting_widget/plotting_widget.py     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
index 782b9f361..03c817222 100755
--- a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
+++ b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
@@ -471,12 +471,17 @@ class PlottingWidget(QtWidgets.QScrollArea):
         :param event: QKeyEvent - event to know what key is pressed
         """
         if event.key() == QtCore.Qt.Key_Escape:
+            try:
+                self.ruler_text.remove()
+                self.ruler_text = None
+            except AttributeError:
+                pass
             for w in self.peer_plotting_widgets:
                 w.set_rulers_invisible()
                 w.zoom_marker1_shown = False
                 try:
-                    self.ruler_text.remove()
-                    self.ruler_text = None
+                    w.ruler_text.remove()
+                    w.ruler_text = None
                 except AttributeError:
                     pass
                 w.draw()
-- 
GitLab