<file>res/images/arrow_turn_start.png</file>
<file>res/images/arrow_turn_u_turn.png</file>
<file>res/images/ruler.png</file>
+ <file>res/images/list_item_bottom_selected.png</file>
+ <file>res/images/list_item_middle_selected.png</file>
+ <file>res/images/list_item_top_selected.png</file>
</qresource>
</RCC>
m_backgroundTopImage.load(":/res/images/list_item_top.png");
m_backgroundMiddleImage.load(":/res/images/list_item_middle.png");
m_backgroundBottomImage.load(":/res/images/list_item_bottom.png");
+ m_backgroundTopSelectedImage.load(":/res/images/list_item_top_selected.png");
+ m_backgroundMiddleSelectedImage.load(":/res/images/list_item_middle_selected.png");
+ m_backgroundBottomSelectedImage.load(":/res/images/list_item_bottom_selected.png");
}
void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
QPixmap image = QPixmap(qvariant_cast<QPixmap>(index.data(AVATAR_IMAGE_INDEX)));
QString name = index.data(TITLE_DISPLAY_INDEX).toString();
QSize size = index.data(ITEM_SIZE_HINT_INDEX).toSize();
+ bool selected = index.data(ITEM_EXPANDED_INDEX).toBool();
QRect itemRect = option.rect;
QRect bottomRect = QRect(topRect.left(), middleRect.bottom(), ITEM_WIDTH,
BACKGROUND_BOTTOM_HEIGHT);
- painter->drawPixmap(topRect, m_backgroundTopImage);
- painter->drawPixmap(middleRect, m_backgroundMiddleImage);
- painter->drawPixmap(bottomRect, m_backgroundBottomImage);
+ if (selected) {
+ painter->drawPixmap(topRect, m_backgroundTopSelectedImage);
+ painter->drawPixmap(middleRect, m_backgroundMiddleSelectedImage);
+ painter->drawPixmap(bottomRect, m_backgroundBottomSelectedImage);
+ } else {
+ painter->drawPixmap(topRect, m_backgroundTopImage);
+ painter->drawPixmap(middleRect, m_backgroundMiddleImage);
+ painter->drawPixmap(bottomRect, m_backgroundBottomImage);
+ }
painter->setPen(Qt::white);
painter->setFont(NOKIA_FONT_NORMAL);
QPixmap m_backgroundBottomImage; ///< Bottom background image
QPixmap m_backgroundMiddleImage; ///< Middle background image
QPixmap m_backgroundTopImage; ///< Top background image
+ QPixmap m_backgroundBottomSelectedImage; ///< Bottom background image
+ QPixmap m_backgroundMiddleSelectedImage; ///< Middle background image
+ QPixmap m_backgroundTopSelectedImage; ///< Top background image
};
#endif // LISTITEMDELEGATE_H