From 179e53591b726acc0c5272e728e398de41fb51c9 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Sat, 2 Nov 2024 00:39:19 +0100 Subject: Adapt to Orca 47 The screen reader Orca has seen some fundamental changes between Orca 46 and Orca 47. While they are improvements overall, they do require changes to Dolphin to preserve the intended user experience for Orca users. The biggest change is perhaps that Orca will now not only announce changes to the currently focused item, but also of its parent, which means we do not need to pass focus around between file items and the main view within Dolphin, but can keep focus on the file items most of the time. This commit implements this. The only exception of when we cannot have focus on the items within the main view is when the current location is empty or not loaded yet. Only then is the focus moved to the view itself and the placeholderMessage is announced. This commit worsens the UX for users of Orca 46 or older, so this should only be merged once most users are on Orca 47 or later. --- src/views/dolphinview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 2f2ff586d..55ab8a27d 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -2342,8 +2342,7 @@ void DolphinView::showLoadingPlaceholder() m_placeholderLabel->setVisible(true); #ifndef QT_NO_ACCESSIBILITY if (QAccessible::isActive()) { - auto accessibleViewInterface = static_cast(QAccessible::queryAccessibleInterface(m_view)); - accessibleViewInterface->announceOverallViewState(m_placeholderLabel->text()); + static_cast(QAccessible::queryAccessibleInterface(m_view))->announceNewlyLoadedLocation(m_placeholderLabel->text()); } #endif } @@ -2352,6 +2351,11 @@ void DolphinView::updatePlaceholderLabel() { m_showLoadingPlaceholderTimer->stop(); if (itemsCount() > 0) { +#ifndef QT_NO_ACCESSIBILITY + if (QAccessible::isActive()) { + static_cast(QAccessible::queryAccessibleInterface(m_view))->announceNewlyLoadedLocation(QString()); + } +#endif m_placeholderLabel->setVisible(false); return; } @@ -2397,8 +2401,7 @@ void DolphinView::updatePlaceholderLabel() m_placeholderLabel->setVisible(true); #ifndef QT_NO_ACCESSIBILITY if (QAccessible::isActive()) { - auto accessibleViewInterface = static_cast(QAccessible::queryAccessibleInterface(m_view)); - accessibleViewInterface->announceOverallViewState(m_placeholderLabel->text()); + static_cast(QAccessible::queryAccessibleInterface(m_view))->announceNewlyLoadedLocation(m_placeholderLabel->text()); } #endif } -- cgit v1.3