calendarui/views/dayview/src/calendaycontainer.cpp
changeset 64 1881ad52dc45
parent 63 a3cb48f6c889
child 70 a5ed90760192
--- a/calendarui/views/dayview/src/calendaycontainer.cpp	Wed Aug 25 14:02:13 2010 +0530
+++ b/calendarui/views/dayview/src/calendaycontainer.cpp	Tue Aug 31 18:15:13 2010 +0530
@@ -247,8 +247,8 @@
     if (eventWidth - mLayoutValues.eventMargin < minWidth) {
 
         // Calculate new margin value
-        // from totalMarginSpace we need to subtract 
-        // mLayoutValues.eventMargin because first margin is always 1.5un
+        // from totalMarginSpace we need to subtract mLayoutValues.eventMargin 
+        // because first margin is always KCalenSpaceBeetwenEvents
         qreal totalMarginSpace = mLayoutValues.eventAreaWidth - minWidth
             * columns - mLayoutValues.eventMargin;
         qreal newMarginValue = totalMarginSpace / (columns - 1);
@@ -259,8 +259,8 @@
         }
         else {
             // There's not enough space
-            // New minWidth is KCalenTimeStripWidth [un] (time stripe only)
-            minWidth = KCalenTimeStripWidth * mLayoutValues.unitInPixels;
+            // New minWidth is KCalenMinTimeStripWidth [un] (time stripe only)
+            minWidth = KCalenMinTimeStripWidth * mLayoutValues.unitInPixels;
             totalMarginSpace = mLayoutValues.eventAreaWidth - minWidth * columns 
 				- mLayoutValues.eventMargin;
             newMarginValue = totalMarginSpace / (columns - 1);
@@ -360,36 +360,39 @@
  */
 void CalenDayContainer::getTimedEventLayoutValues(LayoutValues& layoutValues)
 {
-    // Get the width of content area
+    // Get the width of entire content area
     qreal contentWidth = CalenDayUtils::instance()->contentWidth();
 
-    // 1. Time column width -> eventAreaX[out]
     HbStyle style;
     HbDeviceProfile deviceProfile;
     layoutValues.unitInPixels = deviceProfile.unitValue();
 
+    // Empty right column's width
+    qreal emptyRightColumnWidth = KCalenEmptyRightColumnWidth
+        * layoutValues.unitInPixels;
+
+    // Margins between the overlapping events -> eventMargin[out]
+    layoutValues.eventMargin = KCalenSpaceBeetwenEvents
+        * layoutValues.unitInPixels;
+
+    // Start position (x) for drawing events -> eventAreaX[out]
     if (mInfo && mInfo->AlldayCount()) {
-        layoutValues.eventAreaX = KCalenAllDayEventArea * contentWidth;
+        layoutValues.eventAreaX = KCalenAllDayEventArea * (contentWidth
+            - emptyRightColumnWidth);
     }
     else {
         layoutValues.eventAreaX = 0;
     }
 
-    // 2. event area width -> eventAreaWidth[out]
-    qreal emptyRightColumnWidth = KCalenEmptyRightColumnWidth
-        * layoutValues.unitInPixels;
+    // Event area width (excluding All Day Events area)-> eventAreaWidth[out]
     layoutValues.eventAreaWidth = contentWidth - emptyRightColumnWidth
         - layoutValues.eventAreaX;
 
-    // 3. margins between the overlapping events -> eventMargin[out]
-    layoutValues.eventMargin = KCalenSpaceBeetwenEvents
-        * layoutValues.unitInPixels;
-
-    // 4. half-hour slot'h height -> slotHeight[out]
+    // Half-hour slot's height -> slotHeight[out]
     layoutValues.slotHeight = CalenDayUtils::instance()->hourElementHeight()
         / KCalenSlotsInHour;
 
-    // check if we should create absorber over some overlapping region
+    // Check if touch absorbers should be created over some overlapping regions
     layoutValues.maxColumns = layoutValues.eventAreaWidth
         / ((KCalenMinTouchableEventWidth + KCalenSpaceBeetwenEvents)
             * layoutValues.unitInPixels);