46 HbWidget(parent), mViewFeeder(feeder), mViewerDetails(0), mHeaderGroupBox(0), mSeparator(0), |
46 HbWidget(parent), mViewFeeder(feeder), mViewerDetails(0), mHeaderGroupBox(0), mSeparator(0), |
47 mAddressContainer(0) |
47 mAddressContainer(0) |
48 { |
48 { |
49 this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
49 this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
50 |
50 |
51 HbFrameItem *bgItem = new HbFrameItem(BG_FRAME_GRAPHICS, HbFrameDrawer::NinePieces, this); |
|
52 this->setBackgroundItem(bgItem, -2.0); |
|
53 |
|
54 mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); |
51 mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); |
55 mMainLayout->setSpacing(0); |
52 mMainLayout->setSpacing(0); |
56 mMainLayout->setContentsMargins(0, 0, 0, 0); |
53 mMainLayout->setContentsMargins(0, 0, 0, 0); |
57 |
54 |
58 // Address Group box |
55 // Address Group box |
66 |
63 |
67 mHeaderGroupBox->setContentWidget(mAddressContainer); |
64 mHeaderGroupBox->setContentWidget(mAddressContainer); |
68 |
65 |
69 // Separator |
66 // Separator |
70 mSeparator = new HbFrameItem(DIVIDER_FRAME, HbFrameDrawer::OnePiece, this); |
67 mSeparator = new HbFrameItem(DIVIDER_FRAME, HbFrameDrawer::OnePiece, this); |
71 mSeparator->setMaximumHeight(1); |
68 mSeparator->setMinimumHeight(2.0); |
|
69 mSeparator->frameDrawer().fillWholeRect(); |
72 mSeparator->hide(); |
70 mSeparator->hide(); |
73 |
71 |
74 // Viewer Details widget |
72 // Viewer Details widget |
75 mViewerDetails = new UniViewerDetailsWidget(this); |
73 mViewerDetails = new UniViewerDetailsWidget(this); |
76 |
74 |
|
75 // This widget is created to apply background for header & details. |
|
76 HbWidget *headerContainer = new HbWidget(this); |
|
77 |
|
78 QGraphicsLinearLayout *headerLayout = new QGraphicsLinearLayout(Qt::Vertical, headerContainer); |
|
79 headerLayout->setSpacing(0); |
|
80 headerLayout->setContentsMargins(0, 0, 0, 0); |
|
81 |
|
82 HbFrameItem *bgItem = new HbFrameItem(BG_FRAME_GRAPHICS, HbFrameDrawer::NinePieces, this); |
|
83 headerContainer->setBackgroundItem(bgItem, -2.0); |
|
84 |
77 //Add address group box and insert into layout |
85 //Add address group box and insert into layout |
78 mMainLayout->addItem(mHeaderGroupBox); |
86 headerLayout->addItem(mHeaderGroupBox); |
79 mMainLayout->addItem(mSeparator); |
87 headerLayout->addItem(mSeparator); |
80 mMainLayout->addItem(mViewerDetails); |
88 headerLayout->addItem(mViewerDetails); |
|
89 |
|
90 headerContainer->setLayout(headerLayout); |
|
91 |
|
92 mMainLayout->addItem(headerContainer); |
81 |
93 |
82 this->setLayout(mMainLayout); |
94 this->setLayout(mMainLayout); |
83 } |
95 } |
84 |
96 |
85 //--------------------------------------------------------------- |
97 //--------------------------------------------------------------- |
115 populateAttachments(); |
127 populateAttachments(); |
116 |
128 |
117 // Expand address group box for outgoing messages. |
129 // Expand address group box for outgoing messages. |
118 if (mViewFeeder->isIncoming()) { |
130 if (mViewFeeder->isIncoming()) { |
119 mHeaderGroupBox->setCollapsed(true); |
131 mHeaderGroupBox->setCollapsed(true); |
|
132 addressBoxToggled(true); |
120 } |
133 } |
121 else { |
134 else { |
122 mHeaderGroupBox->setCollapsed(false); |
135 mHeaderGroupBox->setCollapsed(false); |
|
136 addressBoxToggled(false); |
123 } |
137 } |
124 } |
138 } |
125 |
139 |
126 //--------------------------------------------------------------- |
140 //--------------------------------------------------------------- |
127 // UniViewerHeaderContainer :: clearContent |
141 // UniViewerHeaderContainer :: clearContent |