on xenial help sign in
Hotfix Dash 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

commit1cec71b31027e052d4ce575489241e5933f5a0da authorAlbert Astals <albert.astals@canonical.com> dateWed 19 Feb 2014, 18:47 (13 years ago) parentc881874a2b89c4
2 files changed+9−2
plugins/DashViews/listviewwithpageheader.cpp+7 qml/Dash/GenericScopeView.qml+2−2
plugins/DashViews/listviewwithpageheader.cpp+7
@@ -366,6 +366,13 @@ 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+ m_headerItem->setY(-m_minYExtent);
375+ }
369376}
370377
371378void 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 }