summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-09-08 19:27:31 -0800
committerJim Raykowski <raykowj@gmail.com>2022-09-26 05:55:25 +0200
commit947fe0d89dee75ee43515ef7dfb43837d65a45bc (patch)
tree3fc8c819233f9c22abf7c8c896a6e08aa4fd90c0 /svx
parenta6abe4a33568d87904fd49c734af4726878af421 (diff)
tdf#119788 tdf#117173 add accessibility NOTIFICATION role
and use it to make screen readers announce notifications from the 'Find and Replace' dialog Change-Id: Ifcf9304883e2e824ea1b7998d7767e474b87c8b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139709 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/srchdlg.cxx14
-rw-r--r--svx/uiconfig/ui/findreplacedialog.ui3
2 files changed, 11 insertions, 6 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 4f2378881867..69483c124770 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -332,7 +332,6 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi
m_xSearchTmplLB->make_sorted();
m_xSearchAttrText->hide();
- m_xSearchLabel->show();
m_xReplaceTmplLB->make_sorted();
m_xReplaceAttrText->hide();
@@ -574,6 +573,13 @@ void SvxSearchDialog::SetSaveToModule(bool b)
void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
{
m_xSearchLabel->set_label(rStr);
+ if (!rStr.isEmpty())
+ {
+ // hide/show to fire SHOWING state change event so search label text
+ // is announced by screen reader
+ m_xSearchLabel->hide();
+ m_xSearchLabel->show();
+ }
if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))
m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Error);
@@ -1360,9 +1366,6 @@ IMPL_LINK(SvxSearchDialog, CommandHdl_Impl, weld::Button&, rBtn, void)
nModifyFlag = ModifyFlags::NONE;
const SfxPoolItem* ppArgs[] = { pSearchItem.get(), nullptr };
rBindings.ExecuteSynchron( FID_SEARCH_NOW, ppArgs );
-
- // grabbing focus to the search combo box makes the search label read by the screen reader
- m_xSearchLB->grab_focus();
}
else if ( &rBtn == m_xCloseBtn.get() )
{
@@ -2208,7 +2211,8 @@ void SvxSearchDialog::SetModifyFlag_Impl( const weld::Widget* pCtrl )
{
nModifyFlag |= ModifyFlags::Search;
m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Normal);
- SvxSearchDialogWrapper::SetSearchLabel("");
+ if (!SvxSearchDialogWrapper::GetSearchLabel().isEmpty())
+ SvxSearchDialogWrapper::SetSearchLabel("");
}
else if ( m_xReplaceLB.get() == pCtrl )
nModifyFlag |= ModifyFlags::Replace;
diff --git a/svx/uiconfig/ui/findreplacedialog.ui b/svx/uiconfig/ui/findreplacedialog.ui
index 4c1e9d2bc45f..a8401616d339 100644
--- a/svx/uiconfig/ui/findreplacedialog.ui
+++ b/svx/uiconfig/ui/findreplacedialog.ui
@@ -173,6 +173,7 @@
</child>
<child>
<object class="GtkLabel" id="searchlabel">
+ <property name="visible">True</property>
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
<property name="hexpand">True</property>
@@ -181,7 +182,7 @@
<property name="xalign">0</property>
<child internal-child="accessible">
<object class="AtkObject" id="searchlabel-atkobject">
- <property name="AtkObject::accessible-role" translatable="no">static</property>
+ <property name="AtkObject::accessible-role" translatable="no">notification</property>
</object>
</child>
</object>