From 29f9e455a7f03cd0efd53a4230e2cc23577705d3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 May 2013 09:13:20 +0530 Subject: [PATCH] Add a tweak to turn off the highlighting of the book count when using a virtual library --- resources/default_tweaks.py | 5 +++++ src/calibre/gui2/search_restriction_mixin.py | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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)")