diff -r 57d77d90783b -r 97d7f0705d0a userguide/src/HelpKeywordView.cpp --- a/userguide/src/HelpKeywordView.cpp Tue Jun 01 23:20:16 2010 +0300 +++ b/userguide/src/HelpKeywordView.cpp Tue Jun 08 18:34:07 2010 +0800 @@ -31,7 +31,6 @@ #include #include #include -#include #include "HelpDataProvider.h" #include "HelpProxyModel.h" @@ -61,7 +60,6 @@ initSearchList(); initSearchPanel(); initVirtualKeyboard(); - initEmptyLabel(); connect(mainWindow(), SIGNAL(viewReady()), this, SLOT(onViewReady())); } @@ -99,22 +97,17 @@ connect(mVirtualKeyboard, SIGNAL(keypadClosed()), this, SLOT(onHandleKeypadClose())); } -void HelpKeywordView::initEmptyLabel() +HbLabel* HelpKeywordView::label() { - HbLabel* label = mBuilder.findWidget(DOCML_NO_MATCH_LABEL); - label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + return mBuilder.findWidget(DOCML_NO_MATCH_LABEL); } void HelpKeywordView::loadAllContent() { + toolBar()->hide(); mBuilder.load(QRC_DOCML_KEYWORD, DOCML_LAYOUT_SEARCH); ResetSearchPanel(); - toolBar()->hide(); -} - -HbGroupBox* HelpKeywordView::groupBox() -{ - return mBuilder.findWidget(DOCML_GROUPBOX); + } //////////////////////////////////////////////////////////////////////////////////////////// @@ -150,6 +143,35 @@ } } +void HelpKeywordView::updateLabelPos() +{ + HbDeviceProfile profile = HbDeviceProfile::profile(mainWindow()); + qreal unValue = profile.unitValue(); + if(mainWindow()->orientation() == Qt::Vertical) + { + if(mVirtualKeyboard->keypadStatus() == HbVkbHost::HbVkbStatusClosed) + { + label()->setContentsMargins(0,30 * unValue,0,0); + } + else + { + label()->setContentsMargins(0,10 * unValue,0,0); + } + } + else + { + if(mVirtualKeyboard->keypadStatus() == HbVkbHost::HbVkbStatusClosed) + { + label()->setContentsMargins(0,10 * unValue,0,0); + } + else + { + label()->setContentsMargins(0,0,0,0); + label()->setAlignment(label()->alignment() | Qt::AlignVCenter); + } + } +} + //////////////////////////////////////////////////////////////////////////////////////////// // handle system event @@ -217,18 +239,6 @@ } toolBar()->hide(); - - if(criteria.isEmpty()) - { - groupBox()->setHeading(hbTrId(TXT_SETLABEL_SEARCH)); - } - else - { - QString heading = qtTrId(TXT_SETLABEL_SEARCH_RESULTS); - heading.append(COLON); - heading.append(criteria); - groupBox()->setHeading(heading); - } } //////////////////////////////////////////////////////////////////////////////////////////// @@ -239,6 +249,7 @@ updateVisibleItems(false); qreal heightToSet = mainWindow()->layoutRect().height() - mVirtualKeyboard->keyboardArea().height(); this->setMaximumHeight(heightToSet); + updateLabelPos(); } void HelpKeywordView::onHandleKeypadClose() @@ -248,6 +259,13 @@ qreal toolbarHeight = toolBar()->size().height(); qreal height = mainHeight - (toolBar()->isVisible() ? toolbarHeight : 0); this->setMaximumHeight(height); + updateLabelPos(); +} + +void HelpKeywordView::onOrientationChanged(Qt::Orientation orientation) +{ + HelpBaseView::onOrientationChanged(orientation); + updateLabelPos(); } // end of file