diff options
| author | Akseli Lahtinen <[email protected]> | 2025-06-20 00:15:31 +0300 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2025-06-20 00:15:31 +0300 |
| commit | c1e71289082ec7416ac19c822393ea70f63d1b75 (patch) | |
| tree | 58e43ee607af7c6586235417d1056d7df5e8838b /src/kitemviews/kitemlistview.cpp | |
| parent | b1d46a3cbd6dd70a6ec7e31d2d11056a5f5c6d91 (diff) | |
New selection effects
This adds a new selection effect that is similar to what we have in QtQuick file item views.
There are also changes to some usability: Instead of only the icon and text being the clickable area in icon and details mode, the whole selection is now the clickable area.
Otherwise the usability should stay the same, it's mostly a visual change.
See also: https://invent.kde.org/teams/vdg/issues/-/issues/94
Diffstat (limited to 'src/kitemviews/kitemlistview.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 265e41e6c..3ed4df3e7 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -425,7 +425,7 @@ std::optional<int> KItemListView::itemAt(const QPointF &pos) const const KItemListWidget *widget = it.value(); const QPointF mappedPos = widget->mapFromItem(this, pos); - if (widget->contains(mappedPos) || widget->selectionRect().contains(mappedPos)) { + if (widget->contains(mappedPos)) { return it.key(); } } @@ -542,7 +542,7 @@ QRectF KItemListView::itemContextRect(int index) const const KItemListWidget *widget = m_visibleItems.value(index); if (widget) { - contextRect = widget->iconRect() | widget->textRect(); + contextRect = widget->selectionRectCore(); contextRect.translate(itemRect(index).topLeft()); } |
