on xenial help sign in
Hotfix header positioning

Make sure that after calling positionAtBeginning (what we do when swiping from an app back to the dash) the header is correctly in place Also make sure the pageHeader position is not controlled by non curret scopes

commitd379263a85d5122a4cdace95533a6bd3de4ee7cf authorAlbert Astals <albert.astals@canonical.com> dateWed 19 Feb 2014, 17:27 (13 years ago) parentc881874
2 files changed+10−2
plugins/DashViews/listviewwithpageheader.cpp+8 qml/Dash/GenericScopeView.qml+2−2
plugins/DashViews/listviewwithpageheader.cpp+8
@@ -366,6 +366,14 @@ void ListViewWithPageHeader::positionAtBeginning()
366366 m_previousContentY = m_visibleItems.first()->y() - headerHeight;
367367 }
368368 setContentY(m_visibleItems.first()->y() + m_clipItem->y() - headerHeight);
369+ if (m_headerItem) {
370+ // TODO This should not be needed and the code that adjust the m_headerItem position
371+ // in viewportMoved() should be enough but in some cases we have not found a way to reproduce
372+ // yet the code of viewportMoved() fails so here we make sure that at least if we are calling
373+ // positionAtBeginning the header item will be correctly positioned
374+ qDebug() << (-m_minYExtent) << (m_visibleItems.first()->y() + m_clipItem->y() - headerHeight);
375+ m_headerItem->setY(-m_minYExtent);
376+ }
369377}
370378
371379void ListViewWithPageHeader::showHeader()
qml/Dash/GenericScopeView.qml+2−2
@@ -301,14 +301,14 @@ FocusScope {
301301 pageHeader: Item {
302302 implicitHeight: scopeView.tabBarHeight
303303 onHeightChanged: {
304− if (scopeView.pageHeader) {
304+ if (scopeView.pageHeader && scopeView.isCurrent) {
305305 scopeView.pageHeader.height = height;
306306 }
307307 }
308308 onYChanged: positionRealHeader();
309309
310310 function positionRealHeader() {
311− if (scopeView.pageHeader) {
311+ if (scopeView.pageHeader && scopeView.isCurrent) {
312312 scopeView.pageHeader.y = y + parent.y;
313313 }
314314 }