┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistview.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-12-07 23:04:09 +0100
committerPeter Penz <[email protected]>2011-12-07 23:10:00 +0100
commitb358e9928049575cf3118f3950caf52bfa003404 (patch)
treedca93a2c2d8c55c20b7beae93000756ad765dd43 /src/kitemviews/kitemlistview.h
parent5a3e79e4ed7167e2bffb19b2a37db5184a643eee (diff)
Enable "menu key" functionality
Bring back the functionality that a context-menu is opened if the "menu key" has been pressed. In opposite to Dolphin 1.7 the context-menu is shown above the selected item and not on the (probably unrelated) mouse position. A new method KItemListView::itemContextRect() has been introduced: The method is now also used as reference for tooltips which fixes the issue that tooltips had a wrong horizontal alignment in the details-view. BUG: 288366 FIXED-IN: 4.8.0
Diffstat (limited to 'src/kitemviews/kitemlistview.h')
-rw-r--r--src/kitemviews/kitemlistview.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h
index 1da0cd7d2..e44d557b9 100644
--- a/src/kitemviews/kitemlistview.h
+++ b/src/kitemviews/kitemlistview.h
@@ -185,6 +185,18 @@ public:
QRectF itemRect(int index) const;
/**
+ * @return The context rectangle of the item relative to the top/left of
+ * the currently visible area (see KItemListView::offset()). The
+ * context rectangle is defined by by the united rectangle of
+ * the icon rectangle and the text rectangle (see KItemListWidget::iconRect()
+ * and KItemListWidget::textRect()) and is useful as reference for e.g. aligning
+ * a tooltip or a context-menu for an item. Note that a context rectangle will
+ * only be returned for (at least partly) visible items. An empty rectangle will
+ * be returned for fully invisible items.
+ */
+ QRectF itemContextRect(int index) const;
+
+ /**
* Scrolls to the item with the index \a index so that the item
* will be fully visible.
*/