diff options
| author | Peter Penz <[email protected]> | 2011-12-07 23:04:09 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-07 23:10:00 +0100 |
| commit | b358e9928049575cf3118f3950caf52bfa003404 (patch) | |
| tree | dca93a2c2d8c55c20b7beae93000756ad765dd43 /src/kitemviews/kitemlistview.cpp | |
| parent | 5a3e79e4ed7167e2bffb19b2a37db5184a643eee (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.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistview.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index c4c1e3167..d1786273c 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -437,6 +437,19 @@ QRectF KItemListView::itemRect(int index) const return m_layouter->itemRect(index); } +QRectF KItemListView::itemContextRect(int index) const +{ + QRectF contextRect; + + const KItemListWidget* widget = m_visibleItems.value(index); + if (widget) { + contextRect = widget->iconRect() | widget->textRect(); + contextRect.translate(itemRect(index).topLeft()); + } + + return contextRect; +} + void KItemListView::scrollToItem(int index) { const QRectF viewGeometry = geometry(); |
