From 802c2f07b4c5588b4fb35a9fb434cbb56679adbe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 Mar 2025 10:28:20 +0530 Subject: [PATCH] Fix #2101135 [[Enhancement] Toolbar boxes of Look & feel have unnecessary empty space](https://bugs.launchpad.net/calibre/+bug/2101135) --- .../look_feel_tabs/main_interface.py | 4 +- .../look_feel_tabs/main_interface.ui | 408 +++++++++--------- 2 files changed, 206 insertions(+), 206 deletions(-) diff --git a/src/calibre/gui2/preferences/look_feel_tabs/main_interface.py b/src/calibre/gui2/preferences/look_feel_tabs/main_interface.py index fb16361a49..985cd1f596 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/main_interface.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/main_interface.py @@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en' from qt.core import QApplication, QDialog, QFont, QFontDialog, QFontInfo from calibre.constants import ismacos, iswindows -from calibre.gui2 import config, gprefs, icon_resource_manager, qt_app +from calibre.gui2 import config, gprefs, icon_resource_manager from calibre.gui2.preferences import LazyConfigWidgetBase, Setting, set_help_tips from calibre.gui2.preferences.look_feel_tabs.main_interface_ui import Ui_main_interface_tab as Ui_Form from calibre.gui2.widgets import BusyCursor @@ -135,7 +135,7 @@ class MainInterfaceTab(LazyConfigWidgetBase, Ui_Form): self.changed_signal.emit() def build_font_obj(self): - font_info = qt_app.original_font if self.current_font is None else self.current_font + font_info = QApplication.instance().original_font if self.current_font is None else self.current_font font = QFont(*(font_info[:4])) font.setStretch(font_info[4]) return font diff --git a/src/calibre/gui2/preferences/look_feel_tabs/main_interface.ui b/src/calibre/gui2/preferences/look_feel_tabs/main_interface.ui index 365e6af158..4fec350865 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/main_interface.ui +++ b/src/calibre/gui2/preferences/look_feel_tabs/main_interface.ui @@ -11,71 +11,6 @@ - - - - &User interface layout: - - - opt_gui_layout - - - - - - - Show &tooltips in the book list - - - - - - - Adjust &colors - - - - - - - Choose &language (needs restart): - - - opt_language - - - - - - - User interface style (&needs restart): - - - opt_ui_style - - - - - - - - - &Interface font: - - - font_display - - - - - - - true - - - - - @@ -83,29 +18,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Disable popup notifications when calibre completes jobs such a conversion, sending to device etc. The notifications are sent via the operating system notification facility, if available. - - - Disable n&otifications on job completion - - - @@ -113,105 +25,13 @@ - - - - QComboBox::AdjustToMinimumContentsLengthWithIcon - - - 20 - - - - - + + - E&xtra spacing to add between rows in the book list (can be negative): + &User interface layout: - opt_book_list_extra_row_spacing - - - - - - - &Round the corners of covers: - - - opt_cover_corner_radius - - - - - - - Toolbar - - - - - - - - - Show &text under icons: - - - opt_toolbar_text - - - - - - - Use t&wo lines for the text under the icons (needs restart) - - - - - - - Icon si&ze: - - - opt_toolbar_icon_size - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Enable s&ystem tray icon (needs restart) - - - - - - - - - - Show the &splash screen at startup + opt_gui_layout @@ -246,6 +66,13 @@ + + + + Allow using &drag and drop to merge books + + + @@ -256,13 +83,44 @@ - - + + - Allow using &drag and drop to merge books + Show &tooltips in the book list + + + + Choose &language (needs restart): + + + opt_language + + + + + + + + + &Interface font: + + + font_display + + + + + + + true + + + + + @@ -273,26 +131,27 @@ - - + + - Change &icon theme + Show the &splash screen at startup - - - - - 250 - 16777215 - + + + + - - QComboBox::AdjustToMinimumContentsLengthWithIcon + + + + + + User interface style (&needs restart): - - 20 + + opt_ui_style @@ -345,13 +204,154 @@ - - + + - + &Round the corners of covers: + + + opt_cover_corner_radius + + + + Change &icon theme + + + + + + + Toolbar + + + + + + + + + + + + Show &text under icons: + + + opt_toolbar_text + + + + + + + Use t&wo lines for the text under the icons (needs restart) + + + + + + + Icon si&ze: + + + opt_toolbar_icon_size + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + E&xtra spacing to add between rows in the book list (can be negative): + + + opt_book_list_extra_row_spacing + + + + + + + Disable popup notifications when calibre completes jobs such a conversion, sending to device etc. The notifications are sent via the operating system notification facility, if available. + + + Disable n&otifications on job completion + + + + + + + Adjust &colors + + + + + + + QComboBox::AdjustToMinimumContentsLengthWithIcon + + + 20 + + + + + + + Enable s&ystem tray icon (needs restart) + + + + + + + + + + + 250 + 16777215 + + + + QComboBox::AdjustToMinimumContentsLengthWithIcon + + + 20 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + +