X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/51bd6cfdfad4d1be706f6dc125762889c19fcc5a..dbc5fd7a491f95ca4084a113d0f902ea975478fd:/src/kitemviews/kitemlistview.h diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 293f4b1ec..17b7b8880 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -176,7 +176,7 @@ public: * has to take care itself how to visually represent the expanded items provided * by the model. */ - virtual bool supportsItemExpanding() const; + bool supportsItemExpanding() const; /** * @return The rectangle of the item relative to the top/left of @@ -298,6 +298,13 @@ protected: QList visibleItemListWidgets() const; + /** + * Must be called by the derived class if it supports the expanding + * of items. + * @see supportsItemExpanding() + */ + void setSupportsItemExpanding(bool supportsExpanding); + protected slots: virtual void slotItemsInserted(const KItemRangeList& itemRanges); virtual void slotItemsRemoved(const KItemRangeList& itemRanges); @@ -389,14 +396,15 @@ private: void recycleWidget(KItemListWidget* widget); /** - * Changes the index of the widget to \a index. The cell-information - * for the widget gets reset and will be updated in the next doLayout(). + * Changes the index of the widget to \a index and assures a consistent + * update for m_visibleItems and m_visibleCells. The cell-information + * for the new index will not be updated and be initialized as empty cell. */ void setWidgetIndex(KItemListWidget* widget, int index); /** * Changes the index of the widget to \a index. In opposite to - * setWidgetIndex() the cell-information of the widget gets updated. + * setWidgetIndex() the cell-information for the widget gets updated. * This update gives doLayout() the chance to animate the moving * of the item visually (see moveWidget()). */ @@ -414,7 +422,7 @@ private: void updateWidgetProperties(KItemListWidget* widget, int index); /** - * Helper method for createWidget() and setWidgetIndex() to create or update + * Helper method for updateWidgetPropertes() to create or update * the itemlist group-header. */ void updateGroupHeaderForWidget(KItemListWidget* widget); @@ -438,6 +446,26 @@ private: */ void updateVisibleGroupHeaders(); + /** + * @return Index for the item in the list returned by KItemModelBase::groups() + * that represents the group where the item with the index \a index + * belongs to. -1 is returned if no groups are available. + */ + int groupIndexForItem(int index) const; + + /** + * Updates the alternateBackground-property of the widget dependent + * on the state of useAlternateBackgrounds() and the grouping state. + */ + void updateAlternateBackgroundForWidget(KItemListWidget* widget); + + /** + * @return True if alternate backgrounds should be used for the items. + * This is the case if an empty item-size is given and if there + * is more than one visible role. + */ + bool useAlternateBackgrounds() const; + /** * @return The widths of each visible role that is shown in the KItemListHeader. */ @@ -547,6 +575,7 @@ private: private: bool m_enabledSelectionToggles; bool m_grouped; + bool m_supportsItemExpanding; int m_activeTransactions; // Counter for beginTransaction()/endTransaction() LayoutAnimationHint m_endTransactionAnimationHint;