equal
deleted
inserted
replaced
19 #include <QSettings> |
19 #include <QSettings> |
20 #include <QPixmap> |
20 #include <QPixmap> |
21 #include <HbLabel> |
21 #include <HbLabel> |
22 #include <HbColorScheme> |
22 #include <HbColorScheme> |
23 #include <HbStyleLoader> |
23 #include <HbStyleLoader> |
|
24 #include <HbTapGesture> |
|
25 #include <HbEvent> |
24 |
26 |
25 // User includes |
27 // User includes |
26 #include "irhswidgettitlerow.h" |
28 #include "irhswidgettitlerow.h" |
27 #include "irservicedef.h" |
29 #include "irservicedef.h" |
28 #include "irhswidgetuiloader.h" |
30 #include "irhswidgetuiloader.h" |
31 static const QString KIrHsWidgetTitleRowDocML = ":/resource/irhswidgettitlerow.docml"; |
33 static const QString KIrHsWidgetTitleRowDocML = ":/resource/irhswidgettitlerow.docml"; |
32 static const QString KIrHsWidgetTitleRowContainer = "titlerow_layout"; |
34 static const QString KIrHsWidgetTitleRowContainer = "titlerow_layout"; |
33 static const QString KIrHsWidgetStationLogo = "station_logo"; |
35 static const QString KIrHsWidgetStationLogo = "station_logo"; |
34 static const QString KNmHsWidgetStationName = "station_name"; |
36 static const QString KNmHsWidgetStationName = "station_name"; |
35 |
37 |
36 static const QString KStationNameColor = "qtc_hs_list_item_title"; |
38 static const QString KStationNameColor = "qtc_hs_list_item_title_normal"; |
37 static const QString KDefaultStationLogo = "qtg_large_internet_radio"; |
39 static const QString KDefaultStationLogo = "qtg_large_internet_radio"; |
38 |
40 |
39 static const int KIrHsWidgetContentsMargin = 0; |
41 static const int KIrHsWidgetContentsMargin = 0; |
40 static const int KIrHsWidgetLogoSize = 50; // hs widget logo size |
42 static const int KIrHsWidgetLogoSize = 50; // hs widget logo size |
41 |
43 |
43 HbWidget(aParent, aFlags), |
45 HbWidget(aParent, aFlags), |
44 mStationLogo(NULL), |
46 mStationLogo(NULL), |
45 mStationName(NULL) |
47 mStationName(NULL) |
46 { |
48 { |
47 loadUi(); |
49 loadUi(); |
|
50 grabGesture(Qt::TapGesture); |
48 } |
51 } |
49 |
52 |
50 IrHsWidgetTitleRow::~IrHsWidgetTitleRow() |
53 IrHsWidgetTitleRow::~IrHsWidgetTitleRow() |
51 { |
54 { |
52 } |
55 } |
73 } |
76 } |
74 |
77 |
75 void IrHsWidgetTitleRow::setDefaultTitle() |
78 void IrHsWidgetTitleRow::setDefaultTitle() |
76 { |
79 { |
77 #ifdef SUBTITLE_STR_BY_LOCID |
80 #ifdef SUBTITLE_STR_BY_LOCID |
78 mStationName->setPlainText(hbTrId("txt_irad_title_internet_radio")); |
81 mStationName->setPlainText(hbTrId("txt_ir_list_internet_radio")); |
79 #else |
82 #else |
80 mStationName->setPlainText(hbTrId("Internet radio")); |
83 mStationName->setPlainText(hbTrId("Internet Radio")); |
81 #endif |
84 #endif |
82 } |
85 } |
83 |
86 |
84 void IrHsWidgetTitleRow::setStationName(const QString& aStationName) |
87 void IrHsWidgetTitleRow::setStationName(const QString& aStationName) |
85 { |
88 { |
106 void IrHsWidgetTitleRow::setDefaultLogo() |
109 void IrHsWidgetTitleRow::setDefaultLogo() |
107 { |
110 { |
108 mStationLogo->setIcon(KDefaultStationLogo); |
111 mStationLogo->setIcon(KDefaultStationLogo); |
109 } |
112 } |
110 |
113 |
|
114 void IrHsWidgetTitleRow::gestureEvent(QGestureEvent *aEvent) |
|
115 { |
|
116 HbTapGesture *tapGesture = qobject_cast<HbTapGesture *>(aEvent->gesture(Qt::TapGesture)); |
|
117 if (!tapGesture) |
|
118 { |
|
119 return; |
|
120 } |
|
121 |
|
122 if (Qt::GestureFinished == tapGesture->state() |
|
123 && HbTapGesture::Tap == tapGesture->tapStyleHint()) |
|
124 { |
|
125 emit titleRowClicked(); |
|
126 } |
|
127 } |
111 |
128 |
112 void IrHsWidgetTitleRow::mousePressEvent(QGraphicsSceneMouseEvent *aEvent) |
129 //Implemented to receive theme change event |
|
130 //@param QEvent, The change events to be received |
|
131 // |
|
132 void IrHsWidgetTitleRow::changeEvent(QEvent *event) |
113 { |
133 { |
114 Q_UNUSED(aEvent); |
134 if (HbEvent::ThemeChanged == event->type()) |
115 emit titleRowClicked(); |
135 { |
|
136 // get the text color from theme and |
|
137 // set it to station name label |
|
138 mStationName->setTextColor(HbColorScheme::color(KStationNameColor)); |
|
139 } |
|
140 |
|
141 HbWidget::changeEvent(event); |
116 } |
142 } |