phonebookui/cntcommonui/widgets/cntfetchcontactpopup.cpp
changeset 81 640d30f4fb64
parent 72 6abfb1094884
equal deleted inserted replaced
77:c18f9fa7f42e 81:640d30f4fb64
   159     CNT_ENTRY
   159     CNT_ENTRY
   160     
   160     
   161     HbListViewItem* prototype = mListView->listItemPrototype();
   161     HbListViewItem* prototype = mListView->listItemPrototype();
   162     prototype->setTextFormat( Qt::RichText );
   162     prototype->setTextFormat( Qt::RichText );
   163     
   163     
   164     qreal margin;
   164     qreal screenMargin, popupMargin;
   165     HbStyle style;
   165     HbStyle style;
   166     style.parameter("hb-param-margin-gene-popup", margin);
   166     style.parameter("hb-param-margin-gene-screen", screenMargin);
   167 
   167     style.parameter("hb-param-margin-gene-popup", popupMargin);
   168     if (mPopup->mainWindow()->orientation() == Qt::Horizontal)
   168     
   169         margin /= 2;
   169     // screenMargin is the margin between the popup's top edge and the screen's top edge
   170     
   170     qreal height = mVirtualKeyboard->activeViewRect().height() - 
   171     qreal height = mPopup->size().height() - 
   171             mSearch->size().height() -
   172             mVirtualKeyboard->keyboardArea().height() - 
   172             screenMargin;
   173             mSearch->size().height() +
   173 
   174             margin;
       
   175     
       
   176     // in single selection we don't have the "mark all" option
   174     // in single selection we don't have the "mark all" option
   177     if ( mMarkAll->isVisible() )
   175     if ( mMarkAll->isVisible() )
   178     {
   176     {
   179         height = height - mMarkAll->size().height();
   177         height -= mMarkAll->size().height();
       
   178     }
       
   179     
       
   180     // in landscape the headingwidget is not visible
       
   181     if ( mPopup->headingWidget() != NULL )
       
   182     {
       
   183         // 3 popup margin -> on top and below heading widget and between content and heading
       
   184         height -= (mPopup->headingWidget()->size().height() + 3*popupMargin);
       
   185     }
       
   186     else
       
   187     {
       
   188         // 1 popup margin -> between content and "edge" of the popup
       
   189         height -= popupMargin;
   180     }
   190     }
   181 
   191 
   182     mEmptyView->setMaximumHeight( height );
   192     mEmptyView->setMaximumHeight( height );
   183     mListView->setMaximumHeight( height );
   193     mListView->setMaximumHeight( height );
   184     CNT_EXIT
   194     CNT_EXIT
   410     {
   420     {
   411         if ( aOrientation == Qt::Horizontal )
   421         if ( aOrientation == Qt::Horizontal )
   412         {
   422         {
   413             mPopup->setHeadingWidget( NULL );
   423             mPopup->setHeadingWidget( NULL );
   414             mDoc->load( CNT_FETCHLIST_XML, "find_list_landscape");
   424             mDoc->load( CNT_FETCHLIST_XML, "find_list_landscape");
       
   425             
       
   426             //TODO: Remove when Wk40 is released
       
   427             qreal popupWidth = mPopup->mainWindow()->layoutRect().width();
       
   428             mPopup->setMinimumWidth(popupWidth);
       
   429             
   415         }
   430         }
   416         else
   431         else
   417         {
   432         {
   418             if (mPopup->headingWidget() == NULL)
   433             if (mPopup->headingWidget() == NULL)
   419             {
   434             {
   432     {
   447     {
   433         if ( aOrientation == Qt::Horizontal )
   448         if ( aOrientation == Qt::Horizontal )
   434         {
   449         {
   435             mPopup->setHeadingWidget( NULL );
   450             mPopup->setHeadingWidget( NULL );
   436             mDoc->load( CNT_FETCHLIST_XML, "find_empty_landscape" );
   451             mDoc->load( CNT_FETCHLIST_XML, "find_empty_landscape" );
       
   452             //TODO: Remove when Wk40 is released
       
   453             qreal popupWidth = mPopup->mainWindow()->layoutRect().width();
       
   454             mPopup->setMinimumWidth(popupWidth);
   437         }
   455         }
   438         else
   456         else
   439         {
   457         {
   440             if (mPopup->headingWidget() == NULL)
   458             if (mPopup->headingWidget() == NULL)
   441             {
   459             {