Use bold and italic for current cell highlighting. Also improve quickview window performance

This commit is contained in:
Kovid Goyal 2013-05-11 22:33:31 +05:30
commit 79095ba971
2 changed files with 5 additions and 2 deletions

View File

@ -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}').

View File

@ -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):