diff --git a/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp b/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp index b36358ec0d..b2e36a6de3 100644 --- a/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp +++ b/src/calibre/gui2/progress_indicator/QProgressIndicator.cpp @@ -352,7 +352,22 @@ class CalibreStyle: public QProxyStyle { } } return; // }}} - + case PE_FrameFocusRect: // }}} + if (!widget || !widget->property("frame_for_focus").toBool()) + break; + if (const QStyleOptionFocusRect *fropt = qstyleoption_cast(option)) { + if (!(fropt->state & State_KeyboardFocusChange)) + break; + painter->save(); + painter->setRenderHint(QPainter::Antialiasing, true); + painter->translate(0.5, 0.5); + painter->setPen(option->palette.color(QPalette::Text)); + painter->setBrush(Qt::transparent); + painter->drawRoundedRect(option->rect.adjusted(0, 0, -1, -1), 4, 4); + painter->restore(); + return; + } + break; // }}} default: break; } diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index a46021f6f7..2c50634162 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -172,6 +172,7 @@ class TagsView(QTreeView): # {{{ def __init__(self, parent=None): QTreeView.__init__(self, parent=None) + self.setProperty('frame_for_focus', True) self.setMouseTracking(True) self.alter_tb = None self.disable_recounting = False