From b358e9928049575cf3118f3950caf52bfa003404 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 7 Dec 2011 23:04:09 +0100 Subject: 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 --- src/kitemviews/kitemlistview.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/kitemviews/kitemlistview.h') 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 @@ -184,6 +184,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. -- cgit v1.3