From a5414ff115cbec4a39ad940a8cf6fef307ff2e30 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 19 Jun 2017 10:37:25 +0530 Subject: [PATCH] Fix #1698723 [Some screens have a lot of padding while others have none](https://bugs.launchpad.net/calibre/+bug/1698723) --- src/calibre/gui2/preferences/keyboard.py | 9 +++++---- src/calibre/gui2/preferences/tweaks.py | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/preferences/keyboard.py b/src/calibre/gui2/preferences/keyboard.py index 81d450bc42..0b243c8b22 100644 --- a/src/calibre/gui2/preferences/keyboard.py +++ b/src/calibre/gui2/preferences/keyboard.py @@ -20,6 +20,7 @@ class ConfigWidget(ConfigWidgetBase): self.conf_widget = ShortcutConfig(self) self.conf_widget.changed_signal.connect(self.changed_signal) self._layout = l = QVBoxLayout() + l.setContentsMargins(0, 0, 0, 0) self.setLayout(l) l.addWidget(self.conf_widget) @@ -41,8 +42,8 @@ class ConfigWidget(ConfigWidgetBase): def highlight_group(self, group_name): self.conf_widget.highlight_group(group_name) -if __name__ == '__main__': - from PyQt5.Qt import QApplication - app = QApplication([]) - test_widget('Advanced', 'Keyboard') +if __name__ == '__main__': + from calibre.gui2 import Application + app = Application([]) + test_widget('Advanced', 'Keyboard') diff --git a/src/calibre/gui2/preferences/tweaks.py b/src/calibre/gui2/preferences/tweaks.py index 576f1aa8bf..f4e29aa51f 100644 --- a/src/calibre/gui2/preferences/tweaks.py +++ b/src/calibre/gui2/preferences/tweaks.py @@ -571,7 +571,8 @@ class ConfigWidget(ConfigWidgetBase): if __name__ == '__main__': - app = QApplication([]) + from calibre.gui2 import Application + app = Application([]) # Tweaks() # test_widget test_widget('Advanced', 'Tweaks')