┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistview.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-02-08 17:45:22 +0100
committerPeter Penz <[email protected]>2012-02-08 17:48:32 +0100
commit03415d90783979f8e51880b7950721985fee29bf (patch)
tree2e38e2cddbc293f1fa3be44729a079bf03d4ec45 /src/kitemviews/kitemlistview.h
parent3c83d8f14defbec5f09aeeb78de3885535d2dc71 (diff)
Layout optimizations
- Differ internally between margins and paddings - Add a small padding in the icons-view and the compact-views - Optimize the width of the icons-view if previews are shown
Diffstat (limited to 'src/kitemviews/kitemlistview.h')
-rw-r--r--src/kitemviews/kitemlistview.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h
index 50d8908e5..808ff5b3e 100644
--- a/src/kitemviews/kitemlistview.h
+++ b/src/kitemviews/kitemlistview.h
@@ -463,7 +463,9 @@ private:
* the new grid- and item-size. Used to determine whether an animation
* should be done when applying the new layout.
*/
- bool changesItemGridLayout(const QSizeF& newGridSize, const QSizeF& newItemSize) const;
+ bool changesItemGridLayout(const QSizeF& newGridSize,
+ const QSizeF& newItemSize,
+ const QSizeF& newItemMargin) const;
/**
* @param changedItemCount Number of inserted or removed items.
@@ -497,6 +499,13 @@ private:
* value != 0 will be returned.
*/
static int calculateAutoScrollingIncrement(int pos, int range, int oldInc);
+
+ /**
+ * Helper functions for changesItemCount().
+ * @return The number of items that fit into the available size by
+ * respecting the size of the item and the margin between the items.
+ */
+ static int itemsPerSize(qreal size, qreal itemSize, qreal itemMargin);
private:
bool m_enabledSelectionToggles;