diff -r 463f1934e292 -r c348b9772569 ganeswidgets/src/hgmediawall.cpp --- a/ganeswidgets/src/hgmediawall.cpp Fri Jun 11 16:25:05 2010 +0100 +++ b/ganeswidgets/src/hgmediawall.cpp Thu Jul 22 16:36:56 2010 +0100 @@ -19,62 +19,46 @@ #include "hgmediawall_p.h" #include "hgwidgets_p.h" #include "hgcoverflowcontainer.h" -#include +#include +#include + +/* + string name from the mediwall .css for the front cover elevation factor. +*/ +static const QString FRONT_COVER_ELEVATION_FACTOR = QLatin1String("front-cover-elevation-factor"); + HgMediawall::HgMediawall(QGraphicsItem *parent ) : HgWidget( *new HgMediawallPrivate, parent ) { Q_D(HgMediawall); d->q_ptr = this; + + HbStyleLoader::registerFilePath(":/hgmediawall.css"); + HbStyleLoader::registerFilePath(":/hgmediawall_color.css"); + HbStyleLoader::registerFilePath(":/hgmediawall.widgetml"); + d->init(mainWindow()->orientation()); } -HgMediawall::HgMediawall(HgMediawallPrivate &dd, QGraphicsItem *parent) : +HgMediawall::HgMediawall(HgMediawallPrivate &dd, QGraphicsItem *parent) : HgWidget( dd, parent ) { Q_D(HgMediawall); - d->q_ptr = this; + d->q_ptr = this; + + HbStyleLoader::registerFilePath(":/hgmediawall.css"); + HbStyleLoader::registerFilePath(":/hgmediawall_color.css"); + HbStyleLoader::registerFilePath(":/hgmediawall.widgetml"); + d->init(mainWindow()->orientation()); } HgMediawall::~HgMediawall() { -} - -/*! - Sets the placement of the title. -*/ -void HgMediawall::setTitlePosition(LabelPosition position) -{ - Q_D(HgMediawall); - d->setTitlePosition(position); -} - -/*! - Returns the placement of the title. -*/ -HgMediawall::LabelPosition HgMediawall::titlePosition() const -{ - Q_D(const HgMediawall); - return d->titlePosition(); -} - -/*! - Sets the placement of the description. -*/ -void HgMediawall::setDescriptionPosition(LabelPosition position) -{ - Q_D(HgMediawall); - d->setDescriptionPosition(position); -} - -/*! - Returns the placement of the description. -*/ -HgMediawall::LabelPosition HgMediawall::descriptionPosition() const -{ - Q_D(const HgMediawall); - return d->descriptionPosition(); + HbStyleLoader::unregisterFilePath(":/hgmediawall.css"); + HbStyleLoader::unregisterFilePath(":/hgmediawall_color.css"); + HbStyleLoader::unregisterFilePath(":/hgmediawall.widgetml"); } /*! @@ -155,4 +139,20 @@ return d->container()->reflectionsEnabled(); } +void HgMediawall::polish(HbStyleParameters& params) +{ + // Read front cover elevation factor from css file. + params.addParameter( FRONT_COVER_ELEVATION_FACTOR ); + + HbWidget::polish( params ); + + bool success = false; + double factor = params.value( FRONT_COVER_ELEVATION_FACTOR ).toDouble(&success); + if (success) { + Q_D(HgMediawall); + d->container()->setFrontItemElevationFactor(factor); + } +} + + // EOF