diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index bea62aefa9..1042343be8 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -188,7 +188,6 @@ def create_defs(): defs['tag_browser_show_counts'] = True defs['tag_browser_show_tooltips'] = True defs['row_numbers_in_book_list'] = True - defs['hidpi'] = 'auto' defs['tag_browser_item_padding'] = 0.5 defs['paste_isbn_prefixes'] = ['isbn', 'url', 'amazon', 'google'] defs['qv_respects_vls'] = True @@ -889,29 +888,6 @@ def show_temp_dir_error(err): 'Could not create temporary folder, calibre cannot start.') + ' ' + extra, det_msg=traceback.format_exc(), show=True) -def setup_hidpi(): - # This requires Qt >= 5.6 - has_env_setting = False - env_vars = ('QT_AUTO_SCREEN_SCALE_FACTOR', 'QT_SCALE_FACTOR', 'QT_SCREEN_SCALE_FACTORS', 'QT_DEVICE_PIXEL_RATIO') - for v in env_vars: - if os.environ.get(v): - has_env_setting = True - break - hidpi = gprefs['hidpi'] - if hidpi == 'on' or (hidpi == 'auto' and not has_env_setting): - if DEBUG: - prints('Turning on automatic hidpi scaling') - QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling, True) - elif hidpi == 'off': - if DEBUG: - prints('Turning off automatic hidpi scaling') - QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling, False) - for p in env_vars: - os.environ.pop(p, None) - elif DEBUG: - prints('Not controlling automatic hidpi scaling') - - def setup_unix_signals(self): if hasattr(os, 'pipe2'): read_fd, write_fd = os.pipe2(os.O_CLOEXEC | os.O_NONBLOCK) @@ -969,9 +945,6 @@ class Application(QApplication): qargs = [i.encode('utf-8') if isinstance(i, str) else i for i in args] from calibre_extensions import progress_indicator self.pi = progress_indicator - if not ismacos and not headless: - # On OS X high dpi scaling is turned on automatically by the OS, so we dont need to set it explicitly - setup_hidpi() QApplication.setOrganizationName('calibre-ebook.com') QApplication.setOrganizationDomain(QApplication.organizationName()) QApplication.setApplicationVersion(__version__) @@ -986,7 +959,6 @@ class Application(QApplication): if ismacos: from calibre_extensions.cocoa import disable_cocoa_ui_elements disable_cocoa_ui_elements() - self.setAttribute(Qt.ApplicationAttribute.AA_UseHighDpiPixmaps) self.setAttribute(Qt.ApplicationAttribute.AA_SynthesizeTouchForUnhandledMouseEvents, False) try: base_dir() diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index aa6e54639b..fc617837e1 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -423,9 +423,6 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): self.default_author_link = DefaultAuthorLink(self.default_author_link_container) self.default_author_link.changed_signal.connect(self.changed_signal) r('gui_layout', config, restart_required=True, choices=[(_('Wide'), 'wide'), (_('Narrow'), 'narrow')]) - r('hidpi', gprefs, restart_required=True, choices=[(_('Automatic'), 'auto'), (_('On'), 'on'), (_('Off'), 'off')]) - if ismacos: - self.opt_hidpi.setVisible(False), self.label_hidpi.setVisible(False) r('ui_style', gprefs, restart_required=True, choices=[(_('System default'), 'system'), (_('calibre style'), 'calibre')]) r('book_list_tooltips', gprefs) r('dnd_merge', gprefs) diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui index 711a52b221..aa6e7ca374 100644 --- a/src/calibre/gui2/preferences/look_feel.ui +++ b/src/calibre/gui2/preferences/look_feel.ui @@ -50,7 +50,61 @@ &Main interface - + + + + 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. Note that on Windows, you have to enable the system tray icon for notifications to work. + + + Disable n&otifications on job completion + + + + + + + + + + + + + + + + &Interface font: + + + font_display + + + + + + + true + + + + + + + + + + 250 + 16777215 + + + + QComboBox::AdjustToMinimumContentsLengthWithIcon + + + 20 + + + + Disable all animations. Useful if you have a slow/old computer. @@ -60,6 +114,29 @@ + + + + QComboBox::AdjustToMinimumContentsLengthWithIcon + + + 20 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -70,6 +147,41 @@ + + + + Change &icon theme (needs restart) + + + + + + + Allow using &drag and drop to merge books + + + + + + + Show the &splash screen at startup + + + + + + + Show &row numbers in the book list + + + + + + + Draw a &grid in the book list + + + @@ -80,17 +192,24 @@ - - + + - E&xtra spacing to add between rows in the book list (can be negative): + Choose &language (needs restart): - opt_book_list_extra_row_spacing + opt_language - + + + + Enable s&ystem tray icon (needs restart) + + + + px @@ -100,7 +219,7 @@ - + Toolbar @@ -142,181 +261,37 @@ - - + + + + E&xtra spacing to add between rows in the book list (can be negative): + + + opt_book_list_extra_row_spacing + + - + Change &font (needs restart) - - - - - 250 - 16777215 - - - - QComboBox::AdjustToMinimumContentsLengthWithIcon - - - 20 - - + + - - - - Show &tooltips in the book list - - - - + Show &layout buttons in the status bar (needs restart) - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Enable s&ystem tray icon (needs restart) - - - - - - - Choose &language (needs restart): - - - opt_language - - - - - - - - - &Interface font: - - - font_display - - - - - - - true - - - - - - - - - - - - - - - Disable popup notifications when calibre completes jobs such as conversion of books, sending to device, etc. The notifications are sent via the operating system notification facility, if available. - + - Disable n&otifications on job completion - - - - - - - QComboBox::AdjustToMinimumContentsLengthWithIcon - - - 20 - - - - - - - Show the &splash screen at startup - - - - - - - Change &icon theme (needs restart) - - - - - - - Show &row numbers in the book list - - - - - - - Ad&just for high resolution screens (needs restart): - - - opt_hidpi - - - - - - - <p>Whether to automatically adjust the calibre user interface for high resolution (high DPI) monitors. There are three possible values:</p> - -<ul> -<li><b>Automatic</b>: Adjust the user interface if a high resolution monitor is detected. Will respect Qt environment variables controlling high DPI behavior. So if you use the environment variable QT_AUTO_SCREEN_SCALE_FACTOR then it will be used instead of this setting.</li> - -<li><b>On</b>: Same as "Automatic", but ignores Qt environment variables controlling high DPI behavior.</li> - -<li><b>Off</b>: Do not adjust the user interface, regardless of Qt environment variables.</li> -</ul> - - - - - - - Allow using &drag and drop to merge books - - - - - - - Draw a &grid in the book list + Show &tooltips in the book list