From 0ef264056fadfa5ecc21e1d3ca443fe6911f8e94 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 Dec 2021 08:21:34 +0530 Subject: [PATCH] Set an appropriate size hint for the comments dialog --- src/calibre/gui2/dialogs/comments_dialog.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/comments_dialog.py b/src/calibre/gui2/dialogs/comments_dialog.py index 5403095ed1..4e1afe3d20 100644 --- a/src/calibre/gui2/dialogs/comments_dialog.py +++ b/src/calibre/gui2/dialogs/comments_dialog.py @@ -6,7 +6,8 @@ __docformat__ = 'restructuredtext en' __license__ = 'GPL v3' from qt.core import ( - QApplication, QDialog, QDialogButtonBox, QPlainTextEdit, QSize, Qt, QVBoxLayout + QApplication, QDialog, QDialogButtonBox, QPlainTextEdit, QSize, Qt, + QVBoxLayout ) from calibre.gui2 import Application, gprefs @@ -43,6 +44,13 @@ class CommentsDialog(QDialog): geom = gprefs.get('comments_dialog_geom', None) if geom is not None: QApplication.instance().safe_restore_geometry(self, geom) + else: + self.resize(self.sizeHint()) + + def sizeHint(self): + ans = super().sizeHint() + ans.setWidth(500), ans.setHeight(600) + return ans def save_geometry(self): gprefs.set('comments_dialog_geom', bytearray(self.saveGeometry()))