diff --git a/skimage/viewer/plugins/base.py b/skimage/viewer/plugins/base.py index d4873377..85d75b95 100644 --- a/skimage/viewer/plugins/base.py +++ b/skimage/viewer/plugins/base.py @@ -76,7 +76,7 @@ class Plugin(QtGui.QDialog): # Signals used when viewers are linked to the Plugin output. image_updated = pyqtSignal(np.ndarray) - _started = pyqtSignal() + _started = pyqtSignal(int) def __init__(self, image_filter=None, height=0, width=400, useblit=True, dock='bottom'): @@ -201,7 +201,9 @@ class Plugin(QtGui.QDialog): def show(self, main_window=True): """Show plugin.""" super(Plugin, self).show() - self._started.emit() + size = self.frameGeometry() + x_hint = size.x() + size.width() + self._started.emit(x_hint) def closeEvent(self, event): """On close disconnect all artists and events from ImageViewer. diff --git a/skimage/viewer/viewers/core.py b/skimage/viewer/viewers/core.py index b4ad4c4d..d60e5693 100644 --- a/skimage/viewer/viewers/core.py +++ b/skimage/viewer/viewers/core.py @@ -190,21 +190,8 @@ class ImageViewer(QtGui.QMainWindow): def closeEvent(self, event): self.close() - def auto_layout(self): - """Move viewer to top-left and align plugin on right edge of viewer.""" - size = self.frameGeometry() - self.move(0, 0) - # w = size.width() - # h = size.height() - # x = 0 - # y = h - # #TODO: Layout isn't quite correct for multiple plugins (overlaps). - # for p in self.plugins: - # p.move(x, y) - # y += p.frameGeometry().height() - - def _show(self): - self.auto_layout() + def _show(self, x=0): + self.move(x, 0) for p in self.plugins: p.show() super(ImageViewer, self).show()