Add a tweak to turn off the highlighting of the book count when using a virtual library

This commit is contained in:
Kovid Goyal 2013-05-05 09:13:20 +05:30
parent 91bce0e175
commit 29f9e455a7
2 changed files with 9 additions and 2 deletions

View File

@ -531,3 +531,8 @@ numeric_collation = False
# number here. The default is ten libraries. # number here. The default is ten libraries.
many_libraries = 10 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

View File

@ -12,6 +12,7 @@ from PyQt4.Qt import (
from calibre.gui2 import error_dialog, question_dialog from calibre.gui2 import error_dialog, question_dialog
from calibre.gui2.widgets import ComboBoxWithHelp from calibre.gui2.widgets import ComboBoxWithHelp
from calibre.utils.config_base import tweaks
from calibre.utils.icu import sort_key from calibre.utils.icu import sort_key
from calibre.utils.search_query_parser import ParseException from calibre.utils.search_query_parser import ParseException
from calibre.utils.search_query_parser import saved_searches from calibre.utils.search_query_parser import saved_searches
@ -576,8 +577,9 @@ class SearchRestrictionMixin(object):
rows = self.current_view().row_count() rows = self.current_view().row_count()
rbc = max(rows, db.data.get_search_restriction_book_count()) rbc = max(rows, db.data.get_search_restriction_book_count())
t = _("({0} of {1})").format(rows, rbc) t = _("({0} of {1})").format(rows, rbc)
self.search_count.setStyleSheet( if tweaks['highlight_virtual_library_book_count']:
'QLabel { border-radius: 8px; background-color: yellow; }') self.search_count.setStyleSheet(
'QLabel { border-radius: 8px; background-color: yellow; }')
else: # No restriction or not library view else: # No restriction or not library view
if not self.search.in_a_search(): if not self.search.in_a_search():
t = _("(all books)") t = _("(all books)")