cui/uiconfig/ui/objecttitledescdialog.ui |    1 +
 sw/uiconfig/swriter/ui/frmaddpage.ui     |    1 +
 vcl/qt5/QtBuilder.cxx                    |    8 ++++++++
 3 files changed, 10 insertions(+)

New commits:
commit 5599ec55f0a2d752aae1ec235aa440713d32fe42
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Oct 7 08:28:03 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Oct 7 13:59:12 2024 +0200

    tdf#130857 qt a11y weld: Handle "accepts-tab" text view property
    
    Evaluate the "accepts-tab" GtkTextView property [1]
    and set the `tabChangesFocus` QPlainTextEdit property
    based on that, so tab moves focus to the next control
    when "accepts-tab" is set to false in a "GtkTextView"
    object in a .ui file, like the ones where this property
    was newly set in previous commit
    
        Change-Id: I4bbecfc3f967b83768319e68ea3fb1f89b4c5014
        Author: Michael Weghorn <[email protected]>
        Date:   Mon Oct 7 08:10:56 2024 +0200
    
            a11y: Leave accessible description text view on simple tab key
    
    (They're not yet supported by QtInstanceBuilder yet, but
    once they are, that will work as expected.)
    
    [1] https://docs.gtk.org/gtk3/property.TextView.accepts-tab.html
    [2] https://doc.qt.io/qt-6/qplaintextedit.html#tabChangesFocus-prop
    
    Change-Id: Ib1d33f37016a2601aa9ab9c370c9076dbae5bed3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174570
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index db8a8f1033f0..14a1ebd1b8c3 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -359,6 +359,14 @@ void QtBuilder::setProperties(QObject* pObject, stringmap& 
rProps)
                 pLabel->setWordWrap(toBool(rValue));
         }
     }
+    else if (QPlainTextEdit* pTextEdit = 
qobject_cast<QPlainTextEdit*>(pObject))
+    {
+        for (auto const & [ rKey, rValue ] : rProps)
+        {
+            if (rKey == u"accepts-tab")
+                pTextEdit->setTabChangesFocus(!toBool(rValue));
+        }
+    }
     else if (QPushButton* pButton = qobject_cast<QPushButton*>(pObject))
     {
         for (auto const & [ rKey, rValue ] : rProps)
commit faa6749592b7777773a51cb6f350a39aeb67b052
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Oct 7 08:10:56 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Oct 7 13:59:04 2024 +0200

    a11y: Leave accessible description text view on simple tab key
    
    Set the "accepts-tab" property to false for the GtkTextView
    where an accessible description can be set, so pressing
    the tab key moves focus to the next field in the dialog,
    instead of inserting a literal tab character.
    
    This simplifies using the dialog when using the keyboard only.
    For the VCL and GTK implementations, pressing Ctrl+Tab
    would previously be needed to move focus, which is less
    intuitive.
    
    Setting the property does not technically prevent inserting
    tabs, they could still be inserted by copy-pasting
    text containing tabs; just pressing the tab key while
    the text view has focus won't insert them any more.
    (I can't think of any reason to use actual tab characters
    in the accessible description, however.)
    
    Do this for the .ui files used for the following 2 scenarios:
    
    * select QR code object in Writer, open context menu,
      select "Alt Text" context menu entry
    * select an image in Writer, open context menu,
      select "Options" context menu entry, go to the
      "Options" tab page
    
    Change-Id: I4bbecfc3f967b83768319e68ea3fb1f89b4c5014
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174569
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/cui/uiconfig/ui/objecttitledescdialog.ui 
b/cui/uiconfig/ui/objecttitledescdialog.ui
index c27ce4ebd30d..a9de9df7db28 100644
--- a/cui/uiconfig/ui/objecttitledescdialog.ui
+++ b/cui/uiconfig/ui/objecttitledescdialog.ui
@@ -147,6 +147,7 @@
                     <property name="can-focus">True</property>
                     <property name="wrap-mode">word</property>
                     <property name="buffer">textbuffer1</property>
+                    <property name="accepts-tab">False</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="desc_entry-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="objecttitledescdialog|extended_tip|desc_entry">Enter a description 
text. The long description text can be entered to describe a complex object or 
group of objects to users with screen reader software. The description is 
visible as an alternative tag for accessibility tools.</property>
diff --git a/sw/uiconfig/swriter/ui/frmaddpage.ui 
b/sw/uiconfig/swriter/ui/frmaddpage.ui
index 6ca01c28807c..6a5770a80dcf 100644
--- a/sw/uiconfig/swriter/ui/frmaddpage.ui
+++ b/sw/uiconfig/swriter/ui/frmaddpage.ui
@@ -150,6 +150,7 @@
                             <property name="vexpand">True</property>
                             <property name="wrap-mode">word</property>
                             <property name="buffer">textbuffer1</property>
+                            <property name="accepts-tab">False</property>
                             <child internal-child="accessible">
                               <object class="AtkObject" 
id="description-atkobject">
                                 <property 
name="AtkObject::accessible-description" translatable="yes" 
context="frmaddpage|extended_tip|description">Enter a longer description of the 
object, especially if the object is too complex or contains too much detail to 
be described adequately with the short “Text Alternative.” This text is 
available for use by assistive technologies. For images, this text is exported 
with an appropriate tag to HTML and PDF format.</property>

Reply via email to