mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add a tweak to turn off the highlighting of the book count when using a virtual library
This commit is contained in:
parent
91bce0e175
commit
29f9e455a7
@ -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
|
||||
|
@ -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)")
|
||||
|
Loading…
x
Reference in New Issue
Block a user