From d99eccc51e8f274bbaae5a4729c44eda489e427f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 12 May 2013 01:01:28 +0530 Subject: [PATCH] Book list: Make the current cell have a darker background --- src/calibre/gui2/library/views.py | 1 + src/qtcurve/style/qtcurve.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index e6a816621f..1d6cd33e9d 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -139,6 +139,7 @@ class BooksView(QTableView): # {{{ def __init__(self, parent, modelcls=BooksModel, use_edit_metadata_dialog=True): QTableView.__init__(self, parent) + self.setProperty('highlight_current_item', True) self.row_sizing_done = False if not tweaks['horizontal_scrolling_per_column']: diff --git a/src/qtcurve/style/qtcurve.cpp b/src/qtcurve/style/qtcurve.cpp index e5ac94a82e..58a32c3479 100644 --- a/src/qtcurve/style/qtcurve.cpp +++ b/src/qtcurve/style/qtcurve.cpp @@ -5250,6 +5250,9 @@ void Style::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QColor color(hasCustomBackground && hasSolidBackground ? v4Opt->backgroundBrush.color() : palette.color(cg, QPalette::Highlight)); + if (state & State_HasFocus && widget->property("highlight_current_item").toBool()) { + color = color.darker(130); + } bool square((opts.square&SQUARE_LISTVIEW_SELECTION) && (/*(!widget && r.height()<=40 && r.width()>=48) || */ (widget && !widget->inherits("KFilePlacesView") &&