ganeswidgets/src/hgmediawall.cpp
branchGCC_SURGE
changeset 10 c348b9772569
parent 5 4fa04caf0f43
child 11 42505cd701c6
equal deleted inserted replaced
4:463f1934e292 10:c348b9772569
    17 
    17 
    18 #include <hgwidgets/hgmediawall.h>
    18 #include <hgwidgets/hgmediawall.h>
    19 #include "hgmediawall_p.h"
    19 #include "hgmediawall_p.h"
    20 #include "hgwidgets_p.h"
    20 #include "hgwidgets_p.h"
    21 #include "hgcoverflowcontainer.h"
    21 #include "hgcoverflowcontainer.h"
    22 #include <hbmainwindow>
    22 #include <HbMainWindow>
       
    23 #include <HbStyleLoader>
       
    24 
       
    25 /*
       
    26     string name from the mediwall .css for the front cover elevation factor.
       
    27 */
       
    28 static const QString FRONT_COVER_ELEVATION_FACTOR = QLatin1String("front-cover-elevation-factor");
       
    29 
    23 
    30 
    24 HgMediawall::HgMediawall(QGraphicsItem *parent ) :
    31 HgMediawall::HgMediawall(QGraphicsItem *parent ) :
    25     HgWidget( *new HgMediawallPrivate, parent )
    32     HgWidget( *new HgMediawallPrivate, parent )
    26 {
    33 {
    27     Q_D(HgMediawall);
    34     Q_D(HgMediawall);
    28     d->q_ptr = this;
    35     d->q_ptr = this;
       
    36 
       
    37     HbStyleLoader::registerFilePath(":/hgmediawall.css");
       
    38     HbStyleLoader::registerFilePath(":/hgmediawall_color.css");
       
    39     HbStyleLoader::registerFilePath(":/hgmediawall.widgetml");
       
    40 
    29     d->init(mainWindow()->orientation());
    41     d->init(mainWindow()->orientation());
    30 }
    42 }
    31 
    43 
    32 HgMediawall::HgMediawall(HgMediawallPrivate &dd, QGraphicsItem *parent) : 
    44 HgMediawall::HgMediawall(HgMediawallPrivate &dd, QGraphicsItem *parent) :
    33     HgWidget( dd, parent )
    45     HgWidget( dd, parent )
    34 {
    46 {
    35     Q_D(HgMediawall);
    47     Q_D(HgMediawall);
    36     d->q_ptr = this;    
    48     d->q_ptr = this;
       
    49 
       
    50     HbStyleLoader::registerFilePath(":/hgmediawall.css");
       
    51     HbStyleLoader::registerFilePath(":/hgmediawall_color.css");
       
    52     HbStyleLoader::registerFilePath(":/hgmediawall.widgetml");
       
    53 
    37     d->init(mainWindow()->orientation());
    54     d->init(mainWindow()->orientation());
    38 }
    55 }
    39 
    56 
    40 HgMediawall::~HgMediawall()
    57 HgMediawall::~HgMediawall()
    41 {
    58 {
    42 }
    59     HbStyleLoader::unregisterFilePath(":/hgmediawall.css");
    43 
    60     HbStyleLoader::unregisterFilePath(":/hgmediawall_color.css");
    44 /*!
    61     HbStyleLoader::unregisterFilePath(":/hgmediawall.widgetml");
    45     Sets the placement of the title.
       
    46 */
       
    47 void HgMediawall::setTitlePosition(LabelPosition position)
       
    48 {
       
    49     Q_D(HgMediawall);
       
    50     d->setTitlePosition(position);
       
    51 }
       
    52 
       
    53 /*!
       
    54     Returns the placement of the title.
       
    55 */
       
    56 HgMediawall::LabelPosition HgMediawall::titlePosition() const
       
    57 {
       
    58     Q_D(const HgMediawall);
       
    59     return d->titlePosition();
       
    60 }
       
    61 
       
    62 /*!
       
    63     Sets the placement of the description.
       
    64 */
       
    65 void HgMediawall::setDescriptionPosition(LabelPosition position)
       
    66 {
       
    67     Q_D(HgMediawall);
       
    68     d->setDescriptionPosition(position);
       
    69 }
       
    70 
       
    71 /*!
       
    72     Returns the placement of the description.
       
    73 */
       
    74 HgMediawall::LabelPosition HgMediawall::descriptionPosition() const
       
    75 {
       
    76     Q_D(const HgMediawall);
       
    77     return d->descriptionPosition();
       
    78 }
    62 }
    79 
    63 
    80 /*!
    64 /*!
    81     Sets the fontSpec property of the title.
    65     Sets the fontSpec property of the title.
    82 
    66 
   153 {
   137 {
   154     Q_D(const HgMediawall);
   138     Q_D(const HgMediawall);
   155     return d->container()->reflectionsEnabled();
   139     return d->container()->reflectionsEnabled();
   156 }
   140 }
   157 
   141 
       
   142 void HgMediawall::polish(HbStyleParameters& params)
       
   143 {
       
   144     // Read front cover elevation factor from css file.
       
   145     params.addParameter( FRONT_COVER_ELEVATION_FACTOR );
       
   146 
       
   147     HbWidget::polish( params );
       
   148 
       
   149     bool success = false;
       
   150     double factor = params.value( FRONT_COVER_ELEVATION_FACTOR ).toDouble(&success);
       
   151     if (success) {
       
   152         Q_D(HgMediawall);
       
   153         d->container()->setFrontItemElevationFactor(factor);
       
   154     }
       
   155 }
       
   156 
       
   157 
   158 // EOF
   158 // EOF