on xenial help sign in
Hotfix Dash header positioning
1cec71bAlbert Astals
plugins/DashViews/listviewwithpageheader.cpp+7
@@ -366,6 +366,13 @@ void ListViewWithPageHeader::positionAtBeginning()
366 m_previousContentY = m_visibleItems.first()->y() - headerHeight;
366 m_previousContentY = m_visibleItems.first()->y() - headerHeight;
367 }
367 }
368 setContentY(m_visibleItems.first()->y() + m_clipItem->y() - headerHeight);
368 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+ }
369}
376}
370
377
371void ListViewWithPageHeader::showHeader()
378void ListViewWithPageHeader::showHeader()
qml/Dash/GenericScopeView.qml+2−2
@@ -301,14 +301,14 @@ FocusScope {
301 pageHeader: Item {
301 pageHeader: Item {
302 implicitHeight: scopeView.tabBarHeight
302 implicitHeight: scopeView.tabBarHeight
303 onHeightChanged: {
303 onHeightChanged: {
304− if (scopeView.pageHeader) {
304+ if (scopeView.pageHeader && scopeView.isCurrent) {
305 scopeView.pageHeader.height = height;
305 scopeView.pageHeader.height = height;
306 }
306 }
307 }
307 }
308 onYChanged: positionRealHeader();
308 onYChanged: positionRealHeader();
309
309
310 function positionRealHeader() {
310 function positionRealHeader() {
311− if (scopeView.pageHeader) {
311+ if (scopeView.pageHeader && scopeView.isCurrent) {
312 scopeView.pageHeader.y = y + parent.y;
312 scopeView.pageHeader.y = y + parent.y;
313 }
313 }
314 }
314 }