diff -r 42505cd701c6 -r 6c0ec0ccd2d4 ganeswidgets/src/hgmediawall_p.cpp --- a/ganeswidgets/src/hgmediawall_p.cpp Fri Jul 23 10:05:37 2010 +0300 +++ b/ganeswidgets/src/hgmediawall_p.cpp Fri Aug 06 09:27:34 2010 +0300 @@ -16,6 +16,8 @@ */ #include +#include +#include #include "hgmediawall_p.h" #include "hgwidgetitem.h" #include "hgcoverflowcontainer.h" @@ -41,10 +43,12 @@ mTitleItem = new HbTextItem("", q); q->style()->setItemName(mTitleItem, "title"); + mTitleItem->setElideMode(Qt::ElideRight); mDescriptionItem = new HbTextItem("", q); q->style()->setItemName(mDescriptionItem, "description"); - + mDescriptionItem->setElideMode(Qt::ElideRight); + mCenterItemArea = new HgCenterItemArea(q); q->style()->setItemName(mCenterItemArea, "centeritem"); @@ -100,61 +104,6 @@ return HbFontSpec(); } -void HgMediawallPrivate::setTitleAndDescriptionVisibility(HgMediawall::TitleAndDescrVisibility visibility) -{ - FUNC_LOG; - - mTitleAndDescrVisibility = visibility; - - switch (visibility) { - case HgMediawall::TitleVisibilityBothVisible: - qDebug() << "JARI_DEBUG, HgMediawallPrivate::setTitleAndDescriptionVisibility(): TitleVisibilityBothVisible"; - - if (mTitleItem) { - mTitleItem->setVisible(true); - } - if (mDescriptionItem) { - mDescriptionItem->setVisible(true); - } - break; - case HgMediawall::TitleVisibilityTitleVisible: - qDebug() << "JARI_DEBUG, HgMediawallPrivate::setTitleAndDescriptionVisibility(): TitleVisibilityTitleVisible"; - if (mTitleItem) { - mTitleItem->setVisible(true); - } - if (mDescriptionItem) { - mDescriptionItem->setVisible(false); - } - break; - case HgMediawall::TitleVisibilityDescriptionVisible: - qDebug() << "JARI_DEBUG, HgMediawallPrivate::setTitleAndDescriptionVisibility(): TitleVisibilityDescriptionVisible"; - - if (mTitleItem) { - mTitleItem->setVisible(false); - } - if (mDescriptionItem) { - mDescriptionItem->setVisible(true); - } - break; - case HgMediawall::TitleVisibilityBothInvisible: - qDebug() << "JARI_DEBUG, HgMediawallPrivate::setTitleAndDescriptionVisibility(): TitleVisibilityBothInvisible"; - - if (mTitleItem) { - mTitleItem->setVisible(false); - } - if (mDescriptionItem) { - mDescriptionItem->setVisible(false); - } - break; - default: break; - } -} - -HgMediawall::TitleAndDescrVisibility HgMediawallPrivate::titleAndDescriptionVisibility() const -{ - return mTitleAndDescrVisibility; -} - HgCoverflowContainer *HgMediawallPrivate::container() { HANDLE_ERROR_NULL(mContainer); @@ -182,4 +131,17 @@ } } +void HgMediawallPrivate::handleThemeChanged() +{ + HgWidgetPrivate::handleThemeChanged(); + + if (mTitleItem || mDescriptionItem) { + Q_Q(HgMediawall); + + // this is needed to enforce color fetch from CSS + HbEvent themeEvent(HbEvent::ThemeChanged); + QApplication::sendEvent(q, &themeEvent); + } +} + // EOF