diff options
author | Alessandro Portale <aportale@trolltech.com> | 2009-08-12 16:22:32 (GMT) |
---|---|---|
committer | Alessandro Portale <aportale@trolltech.com> | 2009-08-12 16:22:32 (GMT) |
commit | 081078137a6fbc85d6be1437f6afc1d60e4f75f9 (patch) | |
tree | b046514d1cd015731be1a8489c74d0259eaff700 /src | |
parent | a3614f43de22351cd3ad14dce06e79f3111842d1 (diff) | |
download | Qt-081078137a6fbc85d6be1437f6afc1d60e4f75f9.zip Qt-081078137a6fbc85d6be1437f6afc1d60e4f75f9.tar.gz Qt-081078137a6fbc85d6be1437f6afc1d60e4f75f9.tar.bz2 |
Increasing visibility of the focus
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 42be962..50eb2e1 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2042,13 +2042,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti painter->save(); const int penWidth = QS60StylePrivate::focusRectPenWidth(); #ifdef QT_KEYPAD_NAVIGATION - const Qt::PenStyle penStyle = widget->hasEditFocus() ? Qt::SolidLine :Qt::DotLine; + const Qt::PenStyle penStyle = widget->hasEditFocus() ? Qt::SolidLine :Qt::DashLine; const qreal opacity = widget->hasEditFocus() ? 0.6 : 0.4; #else const Qt::PenStyle penStyle = Qt::SolidLine; const qreal opacity = 0.5; #endif - painter->setPen(QPen(option->palette.color(QPalette::Text), penWidth, penStyle)); painter->setRenderHint(QPainter::Antialiasing); painter->setOpacity(opacity); // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred. @@ -2059,7 +2058,15 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti rectAdjustment + penWidth - 1, -rectAdjustment - penWidth + 1, -rectAdjustment - penWidth + 1); - painter->drawRoundedRect(adjustedRect, penWidth * 1.5, penWidth * 1.5); + const qreal roundRectRadius = penWidth * 1.5; +#ifdef QT_KEYPAD_NAVIGATION + if (penStyle != Qt::SolidLine) { + painter->setPen(QPen(option->palette.color(QPalette::HighlightedText), penWidth, Qt::SolidLine)); + painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius); + } +#endif + painter->setPen(QPen((option->palette.color(QPalette::Text), penWidth, penStyle))); + painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius); painter->restore(); } } |