on xenial help sign in
Don't show the sticky section header if the section is empty
commitcbc4c266b9239da79ea6ed4afafe3f5acaa69fb5 authorAlbert Astals <albert.astals@canonical.com> dateTue 22 Jul 2014, 15:54 (12 years ago) parent2663b85
1 file changed+10−5
plugins/Dash/listviewwithpageheader.cpp+10−5
plugins/Dash/listviewwithpageheader.cpp+10−5
@@ -1184,12 +1184,17 @@ void ListViewWithPageHeader::layout()
11841184 // viewport is bigger than the start of the position of the first visible item
11851185 // i.e. the first visible item starts before the viewport, or when the first
11861186 // visible item starts just at the viewport start and it does not have its own section item
1187− if (topSectionStickPos > pos) {
1188− showStickySectionItem = true;
1189− } else if (topSectionStickPos == pos) {
1190− showStickySectionItem = !item->sectionItem();
1191− } else {
1187+ const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1188+ if (section.isEmpty()) {
11921189 showStickySectionItem = false;
1190+ } else {
1191+ if (topSectionStickPos > pos) {
1192+ showStickySectionItem = true;
1193+ } else if (topSectionStickPos == pos) {
1194+ showStickySectionItem = !item->sectionItem();
1195+ } else {
1196+ showStickySectionItem = false;
1197+ }
11931198 }
11941199 if (!showStickySectionItem) {
11951200 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);