Commit d100d636 authored by Yan's avatar Yan
Browse files

Console does not block focus forever

* focus handling improved - when clicking on graph focus is released.
parent 2919cac9
......@@ -160,6 +160,10 @@ def zoom_factory(axis, base_scale, plot_data=None):
def pan_factory(axis, plot=None):
"""pan spectrum when you press a button"""
def pan_fun(event, ax, pd):
#remove focus from other objects when clicking on graph
focusedWidget = QtWidgets.QApplication.focusWidget()
if focusedWidget != None and event.inaxes == ax:
focusedWidget.clearFocus()
# re-scale to origin if doubleclicked
if event.dblclick and event.inaxes == ax:
ax.get_figure()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment