]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphintabwidget.cpp
Overhaul main view accessibility
[dolphin.git] / src / dolphintabwidget.cpp
index 9bfd6076ae132bfac209988235f1831c2146a055..825ff3c7f8c76642edf9175fca5e40a0193fa9a1 100644 (file)
@@ -9,6 +9,7 @@
 #include "dolphin_generalsettings.h"
 #include "dolphintabbar.h"
 #include "dolphinviewcontainer.h"
+#include "views/draganddrophelper.h"
 
 #include <KAcceleratorManager>
 #include <KConfigGroup>
 
 #include <QApplication>
 #include <QDropEvent>
+#include <QStackedWidget>
 
 DolphinTabWidget::DolphinTabWidget(DolphinNavigatorsWidgetAction *navigatorsWidget, QWidget *parent)
     : QTabWidget(parent)
-    , m_dragAndDropHelper{this}
     , m_lastViewedTab(nullptr)
     , m_navigatorsWidget{navigatorsWidget}
 {
@@ -43,6 +44,13 @@ DolphinTabWidget::DolphinTabWidget(DolphinNavigatorsWidgetAction *navigatorsWidg
     setElideMode(Qt::ElideRight);
     setUsesScrollButtons(true);
     setTabBarAutoHide(true);
+
+    auto stackWidget{findChild<QStackedWidget *>()};
+    // i18n: This accessible name will be announced any time the user moves keyboard focus e.g. from the toolbar or the places panel towards the main working
+    // area of Dolphin. It gives structure. This container does not only contain the main view but also the status bar, the search panel, filter, and selection
+    // mode bars, so calling it just a "View" is a bit wrong, but hopefully still gets the point across.
+    stackWidget->setAccessibleName(i18nc("accessible name of Dolphin's view container", "Location View")); // Without this call, the non-descript Qt provided
+                                                                                                           // "Layered Pane" role is announced.
 }
 
 DolphinTabPage *DolphinTabWidget::currentTabPage() const
@@ -394,7 +402,7 @@ void DolphinTabWidget::tabDragMoveEvent(int index, QDragMoveEvent *event)
 {
     if (index >= 0) {
         DolphinView *view = tabPageAt(index)->activeViewContainer()->view();
-        m_dragAndDropHelper.updateDropAction(event, view->url());
+        DragAndDropHelper::updateDropAction(event, view->url());
     }
 }