From c9f5f787b3be52748e02dff2ef55d87238dc08ce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Oct 2013 09:05:54 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 569a531216..816ed5b617 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -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)