mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use bold and italic for current cell highlighting. Also improve quickview window performance
This commit is contained in:
commit
79095ba971
@ -149,6 +149,9 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
key = self.view.model().column_map[self.current_column]
|
key = self.view.model().column_map[self.current_column]
|
||||||
book_id = self.view.model().id(bv_row)
|
book_id = self.view.model().id(bv_row)
|
||||||
|
|
||||||
|
if self.current_book_id == book_id and self.current_key == key:
|
||||||
|
return
|
||||||
|
|
||||||
# Only show items for categories
|
# Only show items for categories
|
||||||
if not self.db.field_metadata[key]['is_category']:
|
if not self.db.field_metadata[key]['is_category']:
|
||||||
if self.current_key is None:
|
if self.current_key is None:
|
||||||
@ -203,8 +206,7 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
sv = selected_item
|
sv = selected_item
|
||||||
sv = sv.replace('"', r'\"')
|
sv = sv.replace('"', r'\"')
|
||||||
self.last_search = self.current_key+':"=' + sv + '"'
|
self.last_search = self.current_key+':"=' + sv + '"'
|
||||||
books = self.db.search_getting_ids(self.last_search,
|
books = self.db.search(self.last_search, return_matches=True)
|
||||||
self.db.data.search_restriction)
|
|
||||||
|
|
||||||
self.books_table.setRowCount(len(books))
|
self.books_table.setRowCount(len(books))
|
||||||
self.books_label.setText(_('Books with selected item "{0}": {1}').
|
self.books_label.setText(_('Books with selected item "{0}": {1}').
|
||||||
|
@ -32,6 +32,7 @@ class HeaderView(QHeaderView): # {{{
|
|||||||
self.hover = -1
|
self.hover = -1
|
||||||
self.current_font = QFont(self.font())
|
self.current_font = QFont(self.font())
|
||||||
self.current_font.setBold(True)
|
self.current_font.setBold(True)
|
||||||
|
self.current_font.setItalic(True)
|
||||||
|
|
||||||
def event(self, e):
|
def event(self, e):
|
||||||
if e.type() in (e.HoverMove, e.HoverEnter):
|
if e.type() in (e.HoverMove, e.HoverEnter):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user