ENH: Align image and plugin windows

This commit is contained in:
Tony S Yu
2012-07-21 23:27:05 -04:00
parent 4d747720de
commit 31c2810dee
+12
View File
@@ -103,7 +103,19 @@ class ImageViewer(QtGui.QMainWindow):
def closeEvent(self, ce):
self.close()
def auto_layout(self):
"""Move viewer to top-left and align plugin on right edge of viewer."""
size = self.geometry()
self.move(0, 0)
w = size.width()
y = 0
#TODO: Layout isn't correct for multiple plots (overlaps).
for p in self.plugins:
p.move(w, y)
y += p.geometry().height()
def show(self):
self.auto_layout()
for p in self.plugins:
p.show()
super(ImageViewer, self).show()