Edit book: Fix the "Show changes" window moving down by a few pixels every time it is opened

This commit is contained in:
Kovid Goyal 2024-01-04 07:36:29 +05:30
parent 6890a437c0
commit 8c0dbb9370
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -218,10 +218,8 @@ class Diff(Dialog):
self.apply_diff_calls = []
self.show_open_in_editor = show_open_in_editor
self.revert_button_msg = revert_button_msg
self.show_as_window = show_as_window
Dialog.__init__(self, _('Differences between books'), 'diff-dialog', parent=parent)
self.setWindowFlags(self.windowFlags() | Qt.WindowType.WindowMinMaxButtonsHint)
if show_as_window:
self.setWindowFlags(Qt.WindowType.Window)
self.view.line_activated.connect(self.line_activated)
def sizeHint(self):
@ -230,6 +228,10 @@ class Diff(Dialog):
def setup_ui(self):
self.setWindowIcon(QIcon.ic('diff.png'))
if self.show_as_window:
self.setWindowFlags(Qt.WindowType.Window)
else:
self.setWindowFlags(self.windowFlags() | Qt.WindowType.WindowMinMaxButtonsHint)
self.stacks = st = QStackedLayout(self)
self.busy = BusyWidget(self)
self.w = QWidget(self)