calendarui/views/dayview/src/calendayutils.cpp
changeset 70 a5ed90760192
parent 64 1881ad52dc45
child 81 ce92091cbd61
--- a/calendarui/views/dayview/src/calendayutils.cpp	Tue Aug 31 18:15:13 2010 +0530
+++ b/calendarui/views/dayview/src/calendayutils.cpp	Mon Sep 06 10:12:45 2010 +0530
@@ -97,6 +97,16 @@
 }
 
 /*!
+ \brief minEventHeight
+ 
+ \return Minimum height of event bubble
+ */
+qreal CalenDayUtils::minEventHeight() const
+{
+    return mMinEventHeight;
+}
+
+/*!
  \brief contentWidth
  
  \return Width of content area
@@ -160,6 +170,7 @@
     }
     mHourElementWidth = calculateHourElementWidth();
     mHourElementHeight = calculateHourElementHeight();
+    mMinEventHeight = calculateMinEventHeight();
 }
 
 /*!
@@ -215,3 +226,27 @@
     
     return prefHeight;
 }
+
+/*!
+ \brief Calculates the height of hour element according to UI spec.
+ 
+ \return Calculated minimum height of event bubble
+ */
+qreal CalenDayUtils::calculateMinEventHeight() const
+{
+    HbStyle style;
+    HbDeviceProfile deviceProfile;
+
+    // Calculate minimum height of event bubble
+    qreal textHeight = 0.0;
+    qreal topSpacing = 0.0;
+    qreal bottomSpacing = 0.0;
+    style.parameter(QString("hb-param-text-height-secondary"), textHeight,
+        deviceProfile);
+    style.parameter(QString("hb-param-margin-gene-top"), topSpacing, 
+        deviceProfile);
+    style.parameter(QString("hb-param-margin-gene-bottom"), bottomSpacing, 
+        deviceProfile);
+    
+    return (topSpacing + textHeight + bottomSpacing);
+}