diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 9851d76af4..368470cced 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -531,3 +531,8 @@ numeric_collation = False # number here. The default is ten libraries. many_libraries = 10 +#: Highlight the count of books when using a Virtual Library +# The count of books next to the Virtual Library button is highlighted in +# yellow when using a Virtual Library. By setting this to False, you can turn +# that off. +highlight_virtual_library_book_count = True diff --git a/src/calibre/gui2/search_restriction_mixin.py b/src/calibre/gui2/search_restriction_mixin.py index c6965aaa6c..7b9fb21340 100644 --- a/src/calibre/gui2/search_restriction_mixin.py +++ b/src/calibre/gui2/search_restriction_mixin.py @@ -12,6 +12,7 @@ from PyQt4.Qt import ( from calibre.gui2 import error_dialog, question_dialog from calibre.gui2.widgets import ComboBoxWithHelp +from calibre.utils.config_base import tweaks from calibre.utils.icu import sort_key from calibre.utils.search_query_parser import ParseException from calibre.utils.search_query_parser import saved_searches @@ -576,8 +577,9 @@ class SearchRestrictionMixin(object): rows = self.current_view().row_count() rbc = max(rows, db.data.get_search_restriction_book_count()) t = _("({0} of {1})").format(rows, rbc) - self.search_count.setStyleSheet( - 'QLabel { border-radius: 8px; background-color: yellow; }') + if tweaks['highlight_virtual_library_book_count']: + self.search_count.setStyleSheet( + 'QLabel { border-radius: 8px; background-color: yellow; }') else: # No restriction or not library view if not self.search.in_a_search(): t = _("(all books)")