Skip to content

Commit

Permalink
Remove frames around widgets that have keyboard focus
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd committed Apr 27, 2021
1 parent 02361ce commit 6b7461c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions styleplugin/basestyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,12 @@ void BaseStyle::drawPrimitive(PrimitiveElement elem,
case PE_FrameDefaultButton:
break;
case PE_FrameFocusRect: {
break;
// probono: We do not want frames around widgets that have keyboard focus;
// also see https://doc.qt.io/qt-5/qfocusframe.html
// TODO: Should probably make this more sophisticated, e.g., make it possible to switch it on
// similar to Qt::WA_MacShowFocusRect, and possibly show it
// after the user has pressed the tab key, or something like that
auto fropt = qstyleoption_cast<const QStyleOptionFocusRect*>(option);
if (!fropt)
break;
Expand Down

0 comments on commit 6b7461c

Please sign in to comment.