--- a/src/hbwidgets/widgets/hbdatetimepicker.cpp Thu Sep 02 20:44:51 2010 +0300
+++ b/src/hbwidgets/widgets/hbdatetimepicker.cpp Fri Sep 17 08:32:10 2010 +0300
@@ -26,6 +26,9 @@
#include "hbdatetimepicker.h"
#include "hbdatetimepicker_p.h"
#include "hbstyleoption_p.h"
+#include "hbframeitem.h"
+#include "hbstyleprimitivedata.h"
+#include <hbstyleframeprimitivedata.h>
/*!
@beta
@@ -254,14 +257,20 @@
bool HbDateTimePicker::event(QEvent *e)
-{
+{
+ Q_D(HbDateTimePicker);
+
bool result = HbWidget::event(e);
- if (e->type()==QEvent::LayoutRequest) {
+ if(e->type() == d->mFormatEventType){
+ d->processFormatEvent();
+ }
+ else if (e->type()==QEvent::LayoutRequest) {
updatePrimitives();
}
return result;
}
+
/*!
Destructor.
*/
@@ -331,10 +340,8 @@
if(d->isFormatValid(format)){
d->mFormat = format;
- d->processDisplaySections();
- d->rearrangeTumbleViews();
- d->emitDateTimeChange();
- }//End If format is valid
+ d->postFormatEvent();
+ }
}
/*!
@@ -805,22 +812,56 @@
updatePrimitives();
}
+void HbDateTimePicker::initPrimitiveData(HbStylePrimitiveData *primitiveData, const QGraphicsObject *primitive)
+{
+ HbWidget::initPrimitiveData(primitiveData, primitive);
+ QString itemName = HbStyle::itemName(primitive);
+ if(itemName == QLatin1String("background")) {
+ HbStyleFramePrimitiveData *frameItem = hbstyleprimitivedata_cast<HbStyleFramePrimitiveData*>(primitiveData);
+ frameItem->frameGraphicsName= QLatin1String("qtg_fr_tumbler_bg");
+ frameItem->frameType = HbFrameDrawer::NinePieces;
+ (const_cast<QGraphicsObject *> (primitive))->setZValue(-5);
+ }
+ if(itemName == QLatin1String("frame")) {
+ HbStyleFramePrimitiveData *frameItem = hbstyleprimitivedata_cast<HbStyleFramePrimitiveData*>(primitiveData);
+ frameItem->frameGraphicsName= QLatin1String("qtg_fr_tumbler_overlay");
+ frameItem->frameType = HbFrameDrawer::NinePieces;
+ (const_cast<QGraphicsObject *> (primitive))->setZValue(1);
+
+ }
+ if(itemName == QLatin1String("highlight")) {
+ HbStyleFramePrimitiveData *frameItem = hbstyleprimitivedata_cast<HbStyleFramePrimitiveData*>(primitiveData);
+ frameItem->frameGraphicsName= QLatin1String("qtg_fr_tumbler_highlight_pri");
+ frameItem->frameType = HbFrameDrawer::ThreePiecesHorizontal;
+ (const_cast<QGraphicsObject *> (primitive))->setZValue(-1);
+
+ }
+
+}
void HbDateTimePicker::updatePrimitives()
{
Q_D(HbDateTimePicker);
- HbStyleOption option;
- initStyleOption(&option);
- if(d->mBackground) {
- HbStylePrivate::updatePrimitive(d->mBackground,HbStylePrivate::P_DateTimePicker_background,&option);
+ HbWidget::updatePrimitives();
+
+ if(d->mBackground){
+ HbStyleFramePrimitiveData data;
+ initPrimitiveData(&data,d->mBackground);
+ style()->updatePrimitive(d->mBackground,&data,this);
}
+
if(d->mFrame) {
- HbStylePrivate::updatePrimitive(d->mFrame,HbStylePrivate::P_DateTimePicker_frame,&option);
+ HbStyleFramePrimitiveData data;
+ initPrimitiveData(&data,d->mFrame);
+ style()->updatePrimitive(d->mFrame,&data,this);
}
if(d->mHighlight) {
- HbStylePrivate::updatePrimitive(d->mHighlight,HbStylePrivate::P_TumbleView_highlight,&option);
+ HbStyleFramePrimitiveData data;
+ initPrimitiveData (&data,d->mHighlight);
+ style()->updatePrimitive(d->mHighlight,&data,this);
}
+
}
#include "moc_hbdatetimepicker.cpp"