equal
deleted
inserted
replaced
14 * Description: Day view control of calendar |
14 * Description: Day view control of calendar |
15 * |
15 * |
16 */ |
16 */ |
17 // System includes |
17 // System includes |
18 #include <QPainter> |
18 #include <QPainter> |
19 #include <hbcolorscheme.h> |
19 #include <HbColorScheme> |
20 |
20 |
21 // User includes |
21 // User includes |
22 #include "CalenDayEventsPane.h" |
22 #include "calendayeventspane.h" |
|
23 #include "calendaycommonheaders.h" |
23 |
24 |
24 /*! |
25 /*! |
25 \class CalenDayEventsPane |
26 \class CalenDayEventsPane |
26 \brief Events pane draws timelines in content view. |
27 \brief Events pane draws timelines in content view. |
27 */ |
28 */ |
37 // Necessary when widget implements own paint method |
38 // Necessary when widget implements own paint method |
38 setFlag(QGraphicsItem::ItemHasNoContents, false); |
39 setFlag(QGraphicsItem::ItemHasNoContents, false); |
39 |
40 |
40 HbDeviceProfile deviceProfile; |
41 HbDeviceProfile deviceProfile; |
41 mUnitInPixels = deviceProfile.unitValue(); |
42 mUnitInPixels = deviceProfile.unitValue(); |
42 mHourLineColor = HbColorScheme::color("qtc_cal_day_hour_lines"); |
43 mHourLineColor = HbColorScheme::color(KCalenHourLineColor); |
43 |
44 |
44 // Set custom dashed pen |
45 // Set custom dashed pen |
45 mCustomDashedPen.setWidth(0.15); |
46 mCustomDashedPen.setWidth(KCalenHourLineThickness); |
46 QVector<qreal> dashes; |
47 QVector<qreal> dashes; |
47 dashes << 5 << 5; |
48 dashes << KCalenHalfHourLineDashWidth * mUnitInPixels |
|
49 << KCalenHalfHourLineDashWidth * mUnitInPixels; |
48 mCustomDashedPen.setDashPattern(dashes); |
50 mCustomDashedPen.setDashPattern(dashes); |
49 mCustomDashedPen.setCapStyle(Qt::FlatCap); |
51 mCustomDashedPen.setCapStyle(Qt::FlatCap); |
50 mCustomDashedPen.setColor(mHourLineColor); |
52 mCustomDashedPen.setColor(mHourLineColor); |
51 } |
53 } |
52 |
54 |
87 { |
89 { |
88 Q_UNUSED(widget) |
90 Q_UNUSED(widget) |
89 |
91 |
90 QRectF drawArea = option->rect; |
92 QRectF drawArea = option->rect; |
91 |
93 |
92 const qreal hourLineThickness = 0.15; //un (according to UI spec) |
94 const qreal hourLineThickness = KCalenHourLineThickness; |
93 |
95 |
94 painter->save(); |
96 painter->save(); |
95 |
97 |
96 // Draw full hour line |
98 // Draw full hour line |
97 QPen linePen = QPen(mHourLineColor, hourLineThickness * mUnitInPixels); |
99 QPen linePen = QPen(mHourLineColor, hourLineThickness * mUnitInPixels); |