ganeswidgets/src/hgmediawall.cpp
branchGCC_SURGE
changeset 10 c348b9772569
parent 5 4fa04caf0f43
child 11 42505cd701c6
--- 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 <hbmainwindow>
+#include <HbMainWindow>
+#include <HbStyleLoader>
+
+/*
+    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