From 8c0dbb9370379c17525aa6ee0b9303f182c31558 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Jan 2024 07:36:29 +0530 Subject: [PATCH] Edit book: Fix the "Show changes" window moving down by a few pixels every time it is opened --- src/calibre/gui2/tweak_book/diff/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tweak_book/diff/main.py b/src/calibre/gui2/tweak_book/diff/main.py index 9ae3ded1d1..6e303767f2 100644 --- a/src/calibre/gui2/tweak_book/diff/main.py +++ b/src/calibre/gui2/tweak_book/diff/main.py @@ -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)