Skip to content
Snippets Groups Projects

Show time label on top of ruler

Merged Kien Le requested to merge feature-#71-time_label_on_top_of_ruler into master
1 unresolved thread
@@ -203,9 +203,15 @@ class PlottingWidget(QtWidgets.QScrollArea):
"""
self.plotting = Plotting(self, self.plotting_axes,
parent_params=parent)
"""
new_min_x: store the new minimum time for zooming; used to fix a
problem where after the first zoom marker is chosen, any ruler that is
to the left of the first zoom marker does not have text above it.
"""
self.new_min_x = float('-inf')
"""
ruler_text: the current text shown above the ruler
"""
self.ruler_text: Optional[matplotlib.text.Text] = None
self.set_colors('B')
@@ -351,6 +357,13 @@ class PlottingWidget(QtWidgets.QScrollArea):
pass
for w in self.peer_plotting_widgets:
if modifiers in [QtCore.Qt.ControlModifier, QtCore.Qt.MetaModifier,
Qt.ShiftModifier]:
try:
w.ruler_text.remove()
w.ruler_text = None
except AttributeError:
pass
if modifiers == QtCore.Qt.ShiftModifier:
w.on_shift_click(xdata)
elif modifiers in [QtCore.Qt.ControlModifier,
Loading