25 |
25 |
26 #include <hbstyleoptionnotificationdialog_p.h> |
26 #include <hbstyleoptionnotificationdialog_p.h> |
27 #include <hbdeviceprofile.h> |
27 #include <hbdeviceprofile.h> |
28 |
28 |
29 #include "hbnotificationdialogcontent_p.h" |
29 #include "hbnotificationdialogcontent_p.h" |
|
30 #include "hbstyle_p.h" |
30 |
31 |
31 HbNotificationDialogContent::HbNotificationDialogContent(QGraphicsWidget *parent) : |
32 HbNotificationDialogContent::HbNotificationDialogContent(QGraphicsWidget *parent) : |
32 HbWidget(parent), mTitleTextWrapping(Hb::TextNoWrap), |
33 HbWidget(parent), mTitleTextWrapping(Hb::TextNoWrap), |
33 mIsTouchActivating(false), mTextItem(0), mTitleItem(0), mIconItem(0) |
34 mIsTouchActivating(false), mTextItem(0), mTitleItem(0), mIconItem(0) |
34 { |
35 { |
35 } |
36 } |
36 |
37 |
|
38 HbNotificationDialogContent::~HbNotificationDialogContent() |
|
39 { |
|
40 |
|
41 } |
|
42 |
37 void HbNotificationDialogContent::setIcon(const HbIcon &icon) |
43 void HbNotificationDialogContent::setIcon(const HbIcon &icon) |
38 { |
44 { |
39 delete mIconItem; |
45 delete mIconItem; |
40 mIconItem = 0; |
46 mIconItem = 0; |
41 |
47 |
42 if (!icon.isNull()) { |
48 if (!icon.isNull()) { |
43 mIconItem = style()->createPrimitive( |
49 mIconItem = HbStylePrivate::createPrimitive( |
44 HbStyle::P_NotificationDialog_icon, this); |
50 HbStylePrivate::P_NotificationDialog_icon, this); |
45 Q_CHECK_PTR(mIconItem); |
51 Q_CHECK_PTR(mIconItem); |
46 } |
52 } |
47 mIcon = icon; |
53 mIcon = icon; |
48 updatePrimitives(); |
54 updatePrimitives(); |
49 if (isVisible()) { |
55 if (isVisible()) { |
175 { |
181 { |
176 HbStyleOptionNotificationDialog option; |
182 HbStyleOptionNotificationDialog option; |
177 initStyleOption(&option); |
183 initStyleOption(&option); |
178 |
184 |
179 if (mTextItem) { |
185 if (mTextItem) { |
180 style()->updatePrimitive(mTextItem, |
186 HbStylePrivate::updatePrimitive(mTextItem, |
181 HbStyle::P_NotificationDialog_text, &option); |
187 HbStylePrivate::P_NotificationDialog_text, &option); |
182 } |
188 } |
183 if (mTitleItem) { |
189 if (mTitleItem) { |
184 style()->updatePrimitive(mTitleItem, |
190 HbStylePrivate::updatePrimitive(mTitleItem, |
185 HbStyle::P_NotificationDialog_title, &option); |
191 HbStylePrivate::P_NotificationDialog_title, &option); |
186 } |
192 } |
187 if (!mIcon.isNull()) { |
193 if (!mIcon.isNull()) { |
188 style()->updatePrimitive(mIconItem, |
194 HbStylePrivate::updatePrimitive(mIconItem, |
189 HbStyle::P_NotificationDialog_icon, &option); |
195 HbStylePrivate::P_NotificationDialog_icon, &option); |
190 } |
196 } |
191 } |
197 } |
192 |
198 |
193 /*! |
199 /*! |
194 \reimp |
200 \reimp |