--- a/calendarui/views/src/calengriditemprototype.cpp Fri Jun 11 13:37:54 2010 +0300
+++ b/calendarui/views/src/calengriditemprototype.cpp Wed Jun 23 18:11:28 2010 +0300
@@ -32,6 +32,7 @@
// User includes
#include "calengriditemprototype.h"
#include "calencommon.h"
+#include "calentodayindicatorlinedrawer.h"
/*!
\class CalenGridItemPrototype
@@ -71,15 +72,25 @@
if (!mFocusIndicatorItem) {
mFocusIndicatorItem = new HbFrameItem(this);
- mFocusIndicatorItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+ mFocusIndicatorItem->frameDrawer().setFrameType(
+ HbFrameDrawer::NinePieces);
mFocusIndicatorItem->setZValue(-1);
- HbStyle::setItemName(mFocusIndicatorItem, QLatin1String("focusIconItem"));
+ HbStyle::setItemName(
+ mFocusIndicatorItem, QLatin1String("focusIconItem"));
}
if (!mEventIndicatorItem) {
mEventIndicatorItem = new HbIconItem(this);
- HbStyle::setItemName(mEventIndicatorItem, QLatin1String("eventIconItem"));
+ HbStyle::setItemName(
+ mEventIndicatorItem, QLatin1String("eventIconItem"));
}
+
+ if (!mTodayIndicatorItem) {
+ mTodayIndicatorItem = new CalenTodayIndicatorLineDrawer(this);
+ HbStyle::setItemName(
+ mTodayIndicatorItem, QLatin1String("todayIndicatorItem"));
+ }
+
}
/*!
@@ -136,8 +147,14 @@
}
// Get the today indicator role
- underlineEnabled = itemList.at(CalendarNamespace::CalendarMonthUnderlineRole).value<bool>();
- drawUnderline(underlineEnabled);
+ underlineEnabled = itemList.at(
+ CalendarNamespace::CalendarMonthUnderlineRole).
+ value<bool>();
+ if(underlineEnabled) {
+ mTodayIndicatorItem->show();
+ } else {
+ mTodayIndicatorItem->hide();
+ }
// Get the event indicator data
monthEventRole = itemList.at(CalendarNamespace::CalendarMonthEventRole).value<bool>();
@@ -166,29 +183,6 @@
}
/*!
- Function to create the underline icon item
- */
-void CalenGridItemPrototype::drawUnderline(bool underlineEnabled)
-{
- if (underlineEnabled) {
- if (!mTodayIndicatorItem) {
- mTodayIndicatorItem = new HbIconItem(this);
- HbStyle::setItemName(mTodayIndicatorItem,
- QLatin1String("todayIndicatorItem"));
- if (mTodayUnderLineColor.isValid()) {
- mTodayIndicatorItem->setColor(mTodayUnderLineColor);
- }
- }
- } else {
- if (mTodayIndicatorItem) {
- delete mTodayIndicatorItem;
- mTodayIndicatorItem = NULL;
- }
- }
-}
-
-
-/*!
Function overwritten to avoid default behavior
*/
void CalenGridItemPrototype::pressStateChanged(bool pressed,bool animate)