calendarui/views/src/calentodayindicatorlinedrawer.cpp
changeset 51 0b38fc5b94c6
parent 45 b6db4fd4947b
equal deleted inserted replaced
46:ecd7b9840282 51:0b38fc5b94c6
    22 #include <hbcolorscheme.h>
    22 #include <hbcolorscheme.h>
    23 #include <hbtheme.h>
    23 #include <hbtheme.h>
    24 
    24 
    25 // User includes
    25 // User includes
    26 #include "CalenTodayIndicatorLineDrawer.h"
    26 #include "CalenTodayIndicatorLineDrawer.h"
       
    27 #include "OstTraceDefinitions.h"
       
    28 #ifdef OST_TRACE_COMPILER_IN_USE
       
    29 #include "calentodayindicatorlinedrawerTraces.h"
       
    30 #endif
       
    31 
    27 
    32 
    28 /*!
    33 /*!
    29  \class CalenTodayIndicatorLineDrawer.
    34  \class CalenTodayIndicatorLineDrawer.
    30 
    35 
    31  Class to draw the today indicator line.
    36  Class to draw the today indicator line.
    35  Constructor.
    40  Constructor.
    36  */
    41  */
    37 CalenTodayIndicatorLineDrawer::CalenTodayIndicatorLineDrawer(
    42 CalenTodayIndicatorLineDrawer::CalenTodayIndicatorLineDrawer(
    38 		QGraphicsItem* parent): HbWidgetBase(parent)
    43 		QGraphicsItem* parent): HbWidgetBase(parent)
    39 {
    44 {
       
    45     OstTraceFunctionEntry0( CALENTODAYINDICATORLINEDRAWER_CALENTODAYINDICATORLINEDRAWER_ENTRY );
       
    46     
    40 	connect(
    47 	connect(
    41 			HbTheme::instance(), SIGNAL(changed()),
    48 			HbTheme::instance(), SIGNAL(changed()),
    42 			this, SLOT(handleThemeChange()));
    49 			this, SLOT(handleThemeChange()));
    43 	setFlag(QGraphicsItem::ItemHasNoContents, false);
    50 	setFlag(QGraphicsItem::ItemHasNoContents, false);
       
    51 	
       
    52 	OstTraceFunctionExit0( CALENTODAYINDICATORLINEDRAWER_CALENTODAYINDICATORLINEDRAWER_EXIT );
    44 }
    53 }
    45 
    54 
    46 /*!
    55 /*!
    47  Destructor.
    56  Destructor.
    48  */
    57  */
    49 CalenTodayIndicatorLineDrawer::~CalenTodayIndicatorLineDrawer()
    58 CalenTodayIndicatorLineDrawer::~CalenTodayIndicatorLineDrawer()
    50 {
    59 {
       
    60     OstTraceFunctionEntry0( DUP1_CALENTODAYINDICATORLINEDRAWER_CALENTODAYINDICATORLINEDRAWER_ENTRY );
    51 
    61 
       
    62     OstTraceFunctionExit0( DUP1_CALENTODAYINDICATORLINEDRAWER_CALENTODAYINDICATORLINEDRAWER_EXIT );
    52 }
    63 }
    53 
    64 
    54 /*!
    65 /*!
    55  To paint the today indicator line.
    66  To paint the today indicator line.
    56  */
    67  */
    57 void CalenTodayIndicatorLineDrawer::paint(
    68 void CalenTodayIndicatorLineDrawer::paint(
    58 		QPainter* painter, const QStyleOptionGraphicsItem* option,
    69 		QPainter* painter, const QStyleOptionGraphicsItem* option,
    59 		QWidget* widget)
    70 		QWidget* widget)
    60 {
    71 {
       
    72     OstTraceFunctionEntry0( CALENTODAYINDICATORLINEDRAWER_PAINT_ENTRY );
       
    73     
    61 	Q_UNUSED(option);
    74 	Q_UNUSED(option);
    62 	Q_UNUSED(widget);
    75 	Q_UNUSED(widget);
    63 	QPen pen;
    76 	QPen pen;
    64 	pen.setStyle(Qt::SolidLine);
    77 	pen.setStyle(Qt::SolidLine);
    65 	pen.setBrush(HbColorScheme::color("qtc_cal_month_current_day"));
    78 	pen.setBrush(HbColorScheme::color("qtc_cal_month_current_day"));
       
    79 	
       
    80 	// Store the old pen
       
    81     QPen oldPen = painter->pen();
       
    82 	    
    66 	painter->setPen(pen);
    83 	painter->setPen(pen);
    67 	QRectF controlRect = this->boundingRect();
    84 	QRectF controlRect = this->boundingRect();
    68 	painter->fillRect(
    85 	painter->fillRect(
    69 			controlRect, HbColorScheme::color("qtc_cal_month_current_day"));
    86 			controlRect, HbColorScheme::color("qtc_cal_month_current_day"));
       
    87 	
       
    88 	// Set the old pen back
       
    89     painter->setPen(oldPen);
       
    90     
       
    91     OstTraceFunctionExit0( CALENTODAYINDICATORLINEDRAWER_PAINT_EXIT );
    70 }
    92 }
    71 
    93 
    72 /*!
    94 /*!
    73  To handle the theme change for the today indicator line.
    95  To handle the theme change for the today indicator line.
    74  */
    96  */
    75 void CalenTodayIndicatorLineDrawer::handleThemeChange()
    97 void CalenTodayIndicatorLineDrawer::handleThemeChange()
    76 {
    98 {
       
    99     OstTraceFunctionEntry0( CALENTODAYINDICATORLINEDRAWER_HANDLETHEMECHANGE_ENTRY );
       
   100     
    77 	update();
   101 	update();
       
   102 	
       
   103 	OstTraceFunctionExit0( CALENTODAYINDICATORLINEDRAWER_HANDLETHEMECHANGE_EXIT );
    78 }
   104 }
    79 
   105 
    80 // End of file  --Don't remove this.
   106 // End of file  --Don't remove this.