[closes #160] the picking window has now a home button for easy reset of zoom

This commit is contained in:
Sebastian Wehling-Benatelli 2015-07-21 08:10:15 +02:00
parent 0e3576d193
commit d9cb3517cc
4 changed files with 17 additions and 4 deletions

View File

@ -16,6 +16,7 @@
<file>icons/key_Z.png</file>
<file>icons/filter.png</file>
<file>icons/sync.png</file>
<file>icons/zoom_0.png</file>
<file>icons/zoom_in.png</file>
<file>icons/zoom_out.png</file>
<file>splash/splash.png</file>

BIN
icons/zoom_0.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

File diff suppressed because one or more lines are too long

View File

@ -237,6 +237,8 @@ class PickDlg(QDialog):
filter_icon.addPixmap(QPixmap(':/icons/filter.png'))
zoom_icon = QIcon()
zoom_icon.addPixmap(QPixmap(':/icons/zoom_in.png'))
home_icon = QIcon()
home_icon.addPixmap(QPixmap(':/icons/zoom_0.png'))
# create actions
self.filterAction = createAction(parent=self, text='Filter',
@ -249,6 +251,9 @@ class PickDlg(QDialog):
slot=self.zoom, icon=zoom_icon,
tip='Zoom into waveform',
checkable=True)
self.resetAction = createAction(parent=self, text='Home',
slot=self.resetZoom, icon=home_icon,
tip='Reset zoom to original limits')
# create other widget elements
self.selectPhase = QComboBox()
@ -263,6 +268,8 @@ class PickDlg(QDialog):
_dialtoolbar.addAction(self.filterAction)
_dialtoolbar.addWidget(self.selectPhase)
_dialtoolbar.addAction(self.zoomAction)
_dialtoolbar.addSeparator()
_dialtoolbar.addAction(self.resetAction)
# layout the innermost widget
_innerlayout = QVBoxLayout()
@ -724,6 +731,11 @@ class PickDlg(QDialog):
self.getPlotWidget().setYLims(new_ylim)
self.draw()
def resetZoom(self):
self.getPlotWidget().setXLims(self.getGlobalLimits('x'))
self.getPlotWidget().setYLims(self.getGlobalLimits('y'))
self.draw()
def draw(self):
self.getPlotWidget().draw()