diff -r b7da29130b0e -r 80e4d18b72f5 src/hbwidgets/itemviews/hbindexfeedback_p.cpp --- a/src/hbwidgets/itemviews/hbindexfeedback_p.cpp Fri Sep 17 08:32:10 2010 +0300 +++ b/src/hbwidgets/itemviews/hbindexfeedback_p.cpp Mon Oct 04 00:38:12 2010 +0300 @@ -26,17 +26,19 @@ #include "hbindexfeedback_p.h" #include "hbindexfeedback.h" +#include #include #include #include #include #include -#include +#include +#include +#include #include #include -#include #include #include @@ -144,6 +146,7 @@ */ void HbIndexFeedbackPrivate::showIndexFeedback() { + Q_Q( HbIndexFeedback ); if (!mItemView || mIndexFeedbackPolicy == HbIndexFeedback::IndexFeedbackNone) { return; @@ -169,7 +172,7 @@ QString testString = displayText(data); if (testString != mPopupContent) { mPopupContent = testString; - updatePrimitives(); + q->updatePrimitives(); } if (mTextItem) { @@ -338,23 +341,6 @@ } /* - Update the primitives for the index feedback. -*/ -void HbIndexFeedbackPrivate::updatePrimitives() -{ - Q_Q( HbIndexFeedback ); - - HbStyleOptionIndexFeedback option; - q->initStyleOption(&option); - if (mTextItem) { - HbStylePrivate::updatePrimitive(mTextItem, HbStylePrivate::P_IndexFeedback_popup_text, &option); - } - if (mPopupItem) { - HbStylePrivate::updatePrimitive(mPopupItem, HbStylePrivate::P_IndexFeedback_popup_background, &option); - } -} - -/* Create the primitives for the index feedback. */ void HbIndexFeedbackPrivate::createPrimitives() @@ -364,13 +350,33 @@ mPopupItemList.clear(); if (!mTextItem) { - mTextItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_IndexFeedback_popup_text, q); + mTextItem = q->style()->createPrimitive(HbStyle::PT_TextItem, QLatin1String("index-text"), q); + mTextItem->setZValue(4); + + HbTextItem *textItem = qobject_cast(mTextItem); + if (textItem) { + textItem->setAlignment(Qt::AlignCenter); + textItem->setTextWrapping(Hb::TextNoWrap); + } + mTextItem->hide(); mPopupItemList.append(mTextItem); } if (!mPopupItem) { - mPopupItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_IndexFeedback_popup_background, q); + mPopupItem = q->style()->createPrimitive(HbStyle::PT_FrameItem, QLatin1String("index-background"), q); + mPopupItem->setZValue(3); + HbFrameItem *frameItem = qobject_cast(mPopupItem); + if (frameItem) { + HbFrameDrawer &frameDrawer(frameItem->frameDrawer()); + frameDrawer.setFrameGraphicsName(QLatin1String("qtg_fr_popup_preview")); + frameDrawer.setFrameType(HbFrameDrawer::NinePieces); + + qreal cornerPieceSize = 0; + q->style()->parameter(QLatin1String("hb-param-background-popup-preview"),cornerPieceSize); + frameDrawer.setBorderWidths(cornerPieceSize, cornerPieceSize, cornerPieceSize, cornerPieceSize); + } + mPopupItem->hide(); mPopupItemList.append(mPopupItem); }