mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix comments editor dialog not displaying toolbar until resized
This commit is contained in:
parent
0ef264056f
commit
10572c8746
@ -7,7 +7,7 @@ __license__ = 'GPL v3'
|
|||||||
|
|
||||||
from qt.core import (
|
from qt.core import (
|
||||||
QApplication, QDialog, QDialogButtonBox, QPlainTextEdit, QSize, Qt,
|
QApplication, QDialog, QDialogButtonBox, QPlainTextEdit, QSize, Qt,
|
||||||
QVBoxLayout
|
QVBoxLayout, QTimer
|
||||||
)
|
)
|
||||||
|
|
||||||
from calibre.gui2 import Application, gprefs
|
from calibre.gui2 import Application, gprefs
|
||||||
@ -46,11 +46,13 @@ class CommentsDialog(QDialog):
|
|||||||
QApplication.instance().safe_restore_geometry(self, geom)
|
QApplication.instance().safe_restore_geometry(self, geom)
|
||||||
else:
|
else:
|
||||||
self.resize(self.sizeHint())
|
self.resize(self.sizeHint())
|
||||||
|
QTimer.singleShot(0, self.update_geometry)
|
||||||
|
|
||||||
|
def update_geometry(self):
|
||||||
|
self.textbox.toolbar.updateGeometry()
|
||||||
|
|
||||||
def sizeHint(self):
|
def sizeHint(self):
|
||||||
ans = super().sizeHint()
|
return QSize(650, 600)
|
||||||
ans.setWidth(500), ans.setHeight(600)
|
|
||||||
return ans
|
|
||||||
|
|
||||||
def save_geometry(self):
|
def save_geometry(self):
|
||||||
gprefs.set('comments_dialog_geom', bytearray(self.saveGeometry()))
|
gprefs.set('comments_dialog_geom', bytearray(self.saveGeometry()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user