mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Set an appropriate size hint for the comments dialog
This commit is contained in:
parent
414fc5f669
commit
0ef264056f
@ -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()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user