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')