mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 06:33:19 +02:00
Set an appropriate size hint for the comments dialog
This commit is contained in:
parent
414fc5f669
commit
0ef264056f
1 changed files with 9 additions and 1 deletions
|
|
@ -6,7 +6,8 @@
|
|||
__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 @@ def __init__(self, parent, text, column_name=None):
|
|||
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…
Reference in a new issue