Edit metadata dialog: Fix incorrect size on multi-screen setup

Edit metadata dialog: The dit metadata dialog currently limits its max
size based on the geometry of the smallet attached screen. Change that
to use the geometry of the screen on which it will be shown.
Fixes #1239597 [metadata window height not remembered](https://bugs.launchpad.net/calibre/+bug/1239597)
This commit is contained in:
Kovid Goyal 2013-10-15 09:05:54 +05:30
parent 78f840906e
commit c9f5f787b3

View File

@ -753,11 +753,13 @@ class ResizableDialog(QDialog):
def __init__(self, *args, **kwargs):
QDialog.__init__(self, *args)
self.setupUi(self)
nh, nw = min_available_height()-25, available_width()-10
desktop = QCoreApplication.instance().desktop()
geom = desktop.availableGeometry(self)
nh, nw = geom.height()-25, geom.width()-10
if nh < 0:
nh = 800
nh = max(800, self.height())
if nw < 0:
nw = 600
nw = max(600, self.height())
nh = min(self.height(), nh)
nw = min(self.width(), nw)
self.resize(nw, nh)