X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/122fee5625f0285ec4ebda79162c72390989eb2a..52da2dc809cde43d2ada7b76e014dd4fee5b62c3:/src/kitemviews/kitemlistcontroller.cpp diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 392dc410e..1db665f47 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -467,6 +467,12 @@ bool KItemListController::keyPressEvent(QKeyEvent *event) case Qt::Key_Space: if (m_selectionBehavior == MultiSelection) { +#ifndef QT_NO_ACCESSIBILITY + // Move accessible focus to the item that is acted upon, so only the state change of this item is announced and not the whole view. + QAccessibleEvent accessibilityEvent(view(), QAccessible::Focus); + accessibilityEvent.setChild(index); + QAccessible::updateAccessibility(&accessibilityEvent); +#endif if (controlPressed) { // Toggle the selection state of the current item. m_selectionManager->endAnchoredSelection(); @@ -700,6 +706,15 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event, const QPointF pos = transform.map(event->pos()); const std::optional index = m_view->itemAt(pos); + if (event->button() & (Qt::ForwardButton | Qt::BackButton)) { + // "Forward" and "Back" are reserved for quickly navigating through the + // history. Double-clicking those buttons should be interpreted as two + // separate button presses. We arrive here for the second click, which + // we now react to just as we would for a singular click + Q_EMIT mouseButtonPressed(index.value_or(-1), event->button()); + return false; + } + if (!index.has_value()) { Q_EMIT doubleClickViewBackground(event->button()); return false; @@ -713,7 +728,7 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event, } } - if (event->button() & Qt::RightButton) { + if (event->button() & ~Qt::LeftButton) { return false; }