calendarui/views/dayview/src/calendayutils.cpp
changeset 70 a5ed90760192
parent 64 1881ad52dc45
child 81 ce92091cbd61
equal deleted inserted replaced
64:1881ad52dc45 70:a5ed90760192
    95 {
    95 {
    96     return mHourElementHeight;
    96     return mHourElementHeight;
    97 }
    97 }
    98 
    98 
    99 /*!
    99 /*!
       
   100  \brief minEventHeight
       
   101  
       
   102  \return Minimum height of event bubble
       
   103  */
       
   104 qreal CalenDayUtils::minEventHeight() const
       
   105 {
       
   106     return mMinEventHeight;
       
   107 }
       
   108 
       
   109 /*!
   100  \brief contentWidth
   110  \brief contentWidth
   101  
   111  
   102  \return Width of content area
   112  \return Width of content area
   103  */
   113  */
   104 qreal CalenDayUtils::contentWidth() const
   114 qreal CalenDayUtils::contentWidth() const
   158     if (HbInstance::instance()->allMainWindows().count() > 0) {
   168     if (HbInstance::instance()->allMainWindows().count() > 0) {
   159         mMainWindow = HbInstance::instance()->allMainWindows().first();
   169         mMainWindow = HbInstance::instance()->allMainWindows().first();
   160     }
   170     }
   161     mHourElementWidth = calculateHourElementWidth();
   171     mHourElementWidth = calculateHourElementWidth();
   162     mHourElementHeight = calculateHourElementHeight();
   172     mHourElementHeight = calculateHourElementHeight();
       
   173     mMinEventHeight = calculateMinEventHeight();
   163 }
   174 }
   164 
   175 
   165 /*!
   176 /*!
   166  \brief Calculates the width of hour element according to UI spec.
   177  \brief Calculates the width of hour element according to UI spec.
   167  
   178  
   213     prefHeight += verticalSpacing * 2;
   224     prefHeight += verticalSpacing * 2;
   214     prefHeight += bottomSpacer;
   225     prefHeight += bottomSpacer;
   215     
   226     
   216     return prefHeight;
   227     return prefHeight;
   217 }
   228 }
       
   229 
       
   230 /*!
       
   231  \brief Calculates the height of hour element according to UI spec.
       
   232  
       
   233  \return Calculated minimum height of event bubble
       
   234  */
       
   235 qreal CalenDayUtils::calculateMinEventHeight() const
       
   236 {
       
   237     HbStyle style;
       
   238     HbDeviceProfile deviceProfile;
       
   239 
       
   240     // Calculate minimum height of event bubble
       
   241     qreal textHeight = 0.0;
       
   242     qreal topSpacing = 0.0;
       
   243     qreal bottomSpacing = 0.0;
       
   244     style.parameter(QString("hb-param-text-height-secondary"), textHeight,
       
   245         deviceProfile);
       
   246     style.parameter(QString("hb-param-margin-gene-top"), topSpacing, 
       
   247         deviceProfile);
       
   248     style.parameter(QString("hb-param-margin-gene-bottom"), bottomSpacing, 
       
   249         deviceProfile);
       
   250     
       
   251     return (topSpacing + textHeight + bottomSpacing);
       
   252 }