diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-12-10 10:50:43 (GMT) |
---|---|---|
committer | Sami Merilä <sami.merila@nokia.com> | 2009-12-10 10:50:43 (GMT) |
commit | e355ade4712fa63794403dae3fda807a58e8b88d (patch) | |
tree | 7995d0fa849b7c0a90c0ea7811aa5df7d262ca90 /src/gui/styles/qs60style.cpp | |
parent | 8d790367928765c861bd437583d12849517839ba (diff) | |
download | Qt-e355ade4712fa63794403dae3fda807a58e8b88d.zip Qt-e355ade4712fa63794403dae3fda807a58e8b88d.tar.gz Qt-e355ade4712fa63794403dae3fda807a58e8b88d.tar.bz2 |
List item is not highlighted before navigating the list
QS60Style does not draw highlight for a list that user has not navigated
in yet. Once user makes navigation attempt, highlight is drawn to
correct index.
This was due to that QS60Style only used State_Selected for deducing
where highlight should be drawn to.
Task-number: QTBUG-6357
Reviewed-by: Janne Anttila
Diffstat (limited to 'src/gui/styles/qs60style.cpp')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 98f4aaf..18ad44d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1317,6 +1317,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, painter->setClipRect(voptAdj.rect); const bool isSelected = (vopt->state & QStyle::State_Selected); + const bool hasFocus = (vopt->state & QStyle::State_HasFocus); bool isScrollBarVisible = false; int scrollBarWidth = 0; @@ -1359,7 +1360,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, &voptAdj, painter, widget);} // draw the focus rect - if (isSelected) { + if (isSelected | hasFocus) { QRect highlightRect = option->rect.adjusted(1,1,-1,-1); QAbstractItemView::SelectionBehavior selectionBehavior = itemView ? itemView->selectionBehavior() : QAbstractItemView::SelectItems; |