Restrict max size of create catalog dialog to available screen space

This commit is contained in:
Kovid Goyal 2017-11-04 04:59:22 +05:30
parent 8a907cacd9
commit 8561f82898
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -130,6 +130,10 @@ class Catalog(QDialog, Ui_Dialog):
self.restoreGeometry(bytes(geom))
else:
self.resize(self.sizeHint())
d = QCoreApplication.instance().desktop()
g = d.availableGeometry(d.screenNumber(self))
self.setMaximumWidth(g.width() - 50)
self.setMaximumHeight(g.height() - 50)
def sizeHint(self):
desktop = QCoreApplication.instance().desktop()