homescreenapp/hsdomainmodel/src/hsidlewidget.cpp
changeset 92 6727c5d0afc7
parent 85 35368b604b28
equal deleted inserted replaced
85:35368b604b28 92:6727c5d0afc7
   139     }
   139     }
   140 }
   140 }
   141 
   141 
   142 /*!
   142 /*!
   143     Layouts the ui layers according to the given \a rect.
   143     Layouts the ui layers according to the given \a rect.
   144     If given \a rect has different size than a fullscreen view, rect
       
   145     is lifted up by statuspane height. Normally HsIdleWidget position is 0,0 
       
   146     relative to it's parent container (HbView). This functionality tackles
       
   147     problem caused by HbStackedLayout which sets top most rect for all items 
       
   148     (views) in a stack (not considering fullscreen mode).
       
   149 */
   144 */
   150 void HsIdleWidget::setGeometry(const QRectF &rect)
   145 void HsIdleWidget::setGeometry(const QRectF &rect)
   151 {
   146 {
   152     
   147     
   153     int n = HsScene::instance()->pages().count();
   148     int n = HsScene::instance()->pages().count();    
   154     QRectF layoutRect(HsGui::instance()->layoutRect());
   149     mControlLayer->resize(rect.size());
   155     if (layoutRect == rect || (layoutRect.height() == rect.width() && layoutRect.width() == rect.height())) {
   150     mPageLayer->resize(n * rect.width(), rect.height());
   156         mControlLayer->resize(rect.size());
   151     if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
   157         mPageLayer->resize(n * rect.width(), rect.height());
   152         mPageWallpaperLayer->resize(n * rect.width(), rect.height());
   158         if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
   153     }
   159             mPageWallpaperLayer->resize(n * rect.width(), rect.height());
   154     mSceneLayer->resize(2 * rect.width() + HSCONFIGURATION_GET(bounceEffect), rect.height());
   160         }
   155     HbWidget::setGeometry(rect);
   161         mSceneLayer->resize(2 * rect.width() + HSCONFIGURATION_GET(bounceEffect), rect.height());
       
   162         HbWidget::setGeometry(rect);
       
   163     } else {
       
   164         QRectF sceneRect = mapToScene(rect).boundingRect();
       
   165         // HbView is a container item for widget, thus 0,0 is relative to view's position.
       
   166         // Lift rect by offset. Fullscreen view is in 0,0 position in scene coordinates otherwise
       
   167         // it's e.g 0,68 (statuspane being at 0,0 and view at 0,68)
       
   168         sceneRect.setTop(-sceneRect.top());
       
   169         HbWidget::setGeometry(sceneRect);
       
   170     }
       
   171 }
   156 }
   172 
   157 
   173 /*!
   158 /*!
   174     Sets the active page \a index to the page
   159     Sets the active page \a index to the page
   175     indicator.
   160     indicator.