calendarui/views/dayview/src/calendaystatusstrip.cpp
changeset 63 a3cb48f6c889
parent 57 bb2d3e476f29
child 70 a5ed90760192
equal deleted inserted replaced
57:bb2d3e476f29 63:a3cb48f6c889
    13  *
    13  *
    14  * Description:  Day view control of calendar
    14  * Description:  Day view control of calendar
    15  *
    15  *
    16  */
    16  */
    17 
    17 
       
    18 // System includes
    18 #include <QPainter>
    19 #include <QPainter>
    19 #include <QPen>
    20 #include <QPen>
    20 
    21 #include <HbColorScheme>
       
    22 
       
    23 // User includes
    21 #include "calendaystatusstrip.h"
    24 #include "calendaystatusstrip.h"
    22 
    25 
       
    26 // Constants
    23 qreal const CalenDayStatusStrip::mMinute = 60;
    27 qreal const CalenDayStatusStrip::mMinute = 60;
    24 qreal const CalenDayStatusStrip::mMinimumTime = 5;
    28 qreal const CalenDayStatusStrip::mMinimumTime = 5;
    25 
    29 
    26 /*!
    30 /*!
    27   Constructor
    31   Constructor
    28  */
    32  */
    29 CalenDayStatusStrip::CalenDayStatusStrip(HbWidget *parent)
    33 CalenDayStatusStrip::CalenDayStatusStrip(HbWidget *parent)
    30     : HbWidget(parent), mRange(2), 
    34     : HbWidget(parent), mRange(2), 
    31       mDrawingStyle(CalenDayStatusStrip::Filled)      
    35       mDrawingStyle(CalenDayStatusStrip::Filled)
    32 {
    36 {
    33     setFlag(QGraphicsItem::ItemHasNoContents,false);
    37     setFlag(QGraphicsItem::ItemHasNoContents,false);
    34 
    38 
    35 }
    39 }
    36 
    40 
    52 {
    56 {
    53     return mRange;
    57     return mRange;
    54 }
    58 }
    55 
    59 
    56 /*!
    60 /*!
    57    \brief Returns color drawing
       
    58    
       
    59    \sa setColor
       
    60  */
       
    61 QColor CalenDayStatusStrip::color() const
       
    62 {
       
    63     return mColor;
       
    64 }
       
    65 
       
    66 /*!
       
    67    \brief Returns style of drawing.
    61    \brief Returns style of drawing.
    68    
    62    
    69    \sa CalenDayStatusStrip::DrawingStyle, setDrawingStyle
    63    \sa CalenDayStatusStrip::DrawingStyle, setDrawingStyle
    70  */
    64  */
    71 CalenDayStatusStrip::DrawingStyle CalenDayStatusStrip::drawingStyle() const
    65 CalenDayStatusStrip::DrawingStyle CalenDayStatusStrip::drawingStyle() const
    92    \sa CalenDayStatusStrip::DrawingStyle, range
    86    \sa CalenDayStatusStrip::DrawingStyle, range
    93  */
    87  */
    94 void CalenDayStatusStrip::setRange(qreal range)
    88 void CalenDayStatusStrip::setRange(qreal range)
    95 {
    89 {
    96     mRange = range;
    90     mRange = range;
    97 }
       
    98 
       
    99 /*!
       
   100    \brief It sets color drawing
       
   101    
       
   102    \param stripColor Color of drawing
       
   103    
       
   104    \sa stripColor
       
   105  */
       
   106 void CalenDayStatusStrip::setColor(QColor stripColor)
       
   107 {
       
   108     mColor = stripColor;
       
   109 }
    91 }
   110 
    92 
   111 /*!
    93 /*!
   112    \brief It sets drawing style of strip 
    94    \brief It sets drawing style of strip 
   113    
    95    
   191 
   173 
   192     //set clip region
   174     //set clip region
   193     painter->setClipRect(bounding, Qt::IntersectClip);
   175     painter->setClipRect(bounding, Qt::IntersectClip);
   194 
   176 
   195     //prepare brush and paint
   177     //prepare brush and paint
   196     QBrush brush(mColor);
   178     QBrush brush(HbColorScheme::color("qtc_cal_month_current_day"));
   197     painter->setBrush(brush);
   179     painter->setBrush(brush);
   198     QPen pen;
   180     QPen pen;
   199     pen.setWidth(1);
   181     pen.setWidth(1);
   200     pen.setBrush(brush);
   182     pen.setBrush(brush);
   201     pen.setCapStyle(Qt::RoundCap);
   183     pen.setCapStyle(Qt::RoundCap);