containments/desktop: consider delegate hovered if it containsMouse

FolderView has a rather complicated setup for deciding whether a
delegate is hovered that depends on multiple components. This is not
great, but fully disentangling them is challenging. The current
situation does lead to some visual defects that we can fix though. For
example, deleting a lot of files while an unrelated file is (actually)
hovered causes it to flicker the hover state as the model is being
reset.

Instead, always show a delegate in the hovered state if it actually
contains the mouse. We still need to take the global hovered state into
account, as we want a folder to be highlighted while dragging something
over it, but not other files, and the global hover tracking handles this
(and the logic in the larger component also requires it at this point).
But at least this takes care of the flickering.
This commit is contained in:
Christoph Wolk 2026-10-27 18:49:48 +01:00
parent 474751ac51
commit 58acc8e576

View file

@ -106,7 +106,7 @@ Item {
anchors.fill: parent
readonly property bool hovered: (main.GridView.view.hoveredItem === main)
readonly property bool hovered: toolTip.containsMouse || (main.GridView.view.hoveredItem === main)
readonly property Item selectionButton: selectionButtonComponent.createObject(actions) as FolderItemActionButton
readonly property int contentHeight: frameLoader.height + frameLoader.y * 2
property alias iconArea: icon