From 5369ee6819a26d9d3f106521c525c03f81a943ce Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 6 Feb 2012 23:26:20 +0100 Subject: Group header improvements - Use a simpler background and colors as suggested by Martin Zilz. This is just an early draft, I need to post some comparison screenshots to Martin for review. - Fixes of some layout issues that have been revealed because of adjusting the group header heights. - More clever animation/no-animation detection when doing listview-property changes in parallel. --- src/kitemviews/kitemlistview.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index e675df221..50d8908e5 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -202,8 +202,20 @@ public: */ void scrollToItem(int index); + /** + * If several properties of KItemListView are changed synchronously, it is + * recommended to encapsulate the calls between beginTransaction() and endTransaction(). + * This prevents unnecessary and expensive layout-calculations. + */ void beginTransaction(); + + /** + * Counterpart to beginTransaction(). The layout changes will only be animated if + * all property changes between beginTransaction() and endTransaction() support + * animations. + */ void endTransaction(); + bool isTransactionActive() const; /** @@ -468,6 +480,12 @@ private: */ bool scrollBarRequired(const QSizeF& size) const; + /** + * Applies the height of the group header to the layouter. The height + * depends on the used scroll orientation. + */ + void updateGroupHeaderHeight(); + /** * Helper function for triggerAutoScrolling(). * @param pos Logical position of the mouse relative to the range. @@ -484,6 +502,7 @@ private: bool m_enabledSelectionToggles; bool m_grouped; int m_activeTransactions; // Counter for beginTransaction()/endTransaction() + LayoutAnimationHint m_endTransactionAnimationHint; QSizeF m_itemSize; KItemListController* m_controller; -- cgit v1.3