~mterry/unity8/new-input-proxies

« back to all changes in this revision

Viewing changes to plugins/Dash/listviewwithpageheader.cpp

  • Committer: Michael Terry
  • Date: 2016-02-16 14:21:48 UTC
  • mfrom: (2136.1.44 origin/kbdLayout)
  • Revision ID: michael.terry@canonical.com-20160216142148-bsy6x3sxsoi3rdl3
Merge kbdLayout branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
        Q_FOREACH(ListItem *item, m_visibleItems)
220
220
            releaseItem(item);
221
221
        m_visibleItems.clear();
222
 
        m_firstVisibleIndex = -1;
223
 
        adjustMinYExtent();
224
 
        setContentY(0);
225
 
        m_clipItem->setY(0);
226
 
        if (m_topSectionItem) {
227
 
            QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
228
 
        }
 
222
        initializeValuesForEmptyList();
229
223
 
230
224
        m_delegateModel->setDelegate(delegate);
231
225
 
236
230
    }
237
231
}
238
232
 
 
233
void ListViewWithPageHeader::initializeValuesForEmptyList()
 
234
{
 
235
    m_firstVisibleIndex = -1;
 
236
    adjustMinYExtent();
 
237
    setContentY(0);
 
238
    m_clipItem->setY(0);
 
239
    if (m_topSectionItem) {
 
240
        QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
 
241
    }
 
242
}
 
243
 
239
244
QQuickItem *ListViewWithPageHeader::header() const
240
245
{
241
246
    return m_headerItem;
835
840
        }
836
841
    }
837
842
    if (!foundVisible) {
838
 
        m_firstVisibleIndex = -1;
 
843
        initializeValuesForEmptyList();
839
844
    }
840
845
    if (m_firstVisibleIndex != oldFirstVisibleIndex) {
841
846
        adjustMinYExtent();
1092
1097
    }
1093
1098
 
1094
1099
    if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1095
 
        adjustMinYExtent();
 
1100
        if (m_visibleItems.isEmpty()) {
 
1101
            initializeValuesForEmptyList();
 
1102
        } else {
 
1103
            adjustMinYExtent();
 
1104
        }
1096
1105
    }
1097
1106
 
1098
1107
    for (int i = 0; i < m_visibleItems.count(); ++i) {