sw/source/ui/fldui/fldvar.cxx        |    4 -
 sw/uiconfig/swriter/ui/fldrefpage.ui |   82 +++++++++--------------------------
 sw/uiconfig/swriter/ui/fldvarpage.ui |    5 +-
 3 files changed, 28 insertions(+), 63 deletions(-)

New commits:
commit c4c1e925eddad2b090e2f0e4c2e1b17f8bb949ae
Author:     Parth Raiyani <[email protected]>
AuthorDate: Wed Jan 28 15:19:25 2026 +0530
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Jan 29 12:06:07 2026 +0100

    a11y: enhance accessibility in fldrefpage.ui and fldvarpage.ui
    
    - restructure filter GtkEntry for better UI and accessibility
    - add mnemonic-widget to correctly reference GtkLabel with relevant object
    - rename conflicting label ids
    - make the frame label visible
    
    Change-Id: I3dbb8e0808906ae2c8701f385abdd8644d393333
    Signed-off-by: Parth Raiyani <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198305
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 1630b1ef596b..d580674a5b91 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -45,9 +45,9 @@ SwFieldVarPage::SwFieldVarPage(weld::Container* pPage, 
weld::DialogController* p
     , m_xTypeLB(m_xBuilder->weld_tree_view(u"type"_ustr))
     , m_xSelection(m_xBuilder->weld_widget(u"selectframe"_ustr))
     , m_xSelectionLB(m_xBuilder->weld_tree_view(u"select"_ustr))
-    , m_xNameFT(m_xBuilder->weld_label(u"nameft"_ustr))
+    , m_xNameFT(m_xBuilder->weld_label(u"fldvarnameft"_ustr))
     , m_xNameED(m_xBuilder->weld_entry(u"name"_ustr))
-    , m_xValueFT(m_xBuilder->weld_label(u"valueft"_ustr))
+    , m_xValueFT(m_xBuilder->weld_label(u"fldvarvalueft"_ustr))
     , m_xValueED(new 
ConditionEdit<weld::TextView>(m_xBuilder->weld_text_view(u"value"_ustr)))
     , m_xFormat(m_xBuilder->weld_widget(u"formatframe"_ustr))
     , m_xNumFormatLB(new 
SwNumFormatTreeView(m_xBuilder->weld_tree_view(u"numformat"_ustr)))
diff --git a/sw/uiconfig/swriter/ui/fldrefpage.ui 
b/sw/uiconfig/swriter/ui/fldrefpage.ui
index 8398e0a2ccf8..68b9863f3894 100644
--- a/sw/uiconfig/swriter/ui/fldrefpage.ui
+++ b/sw/uiconfig/swriter/ui/fldrefpage.ui
@@ -249,61 +249,6 @@
             <property name="vexpand">True</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
-            <child>
-              <!-- n-columns=1 n-rows=2 -->
-              <object class="GtkGrid" id="grid3">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-                <property name="row-spacing">6</property>
-                <child>
-                  <object class="GtkBox" id="box3">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="margin-start">5</property>
-                    <property name="margin-end">5</property>
-                    <child>
-                      <object class="GtkLabel" id="label4">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="margin-end">5</property>
-                        <property name="label" translatable="yes" 
context="fldrefpage|label4">Selection</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left-attach">0</property>
-                    <property name="top-attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="filter">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <property name="hexpand">True</property>
-                    <property name="activates-default">True</property>
-                    <property name="truncate-multiline">True</property>
-                    <property name="placeholder-text" translatable="yes" 
context="fldrefpage|filter">Filter Selection</property>
-                  </object>
-                  <packing>
-                    <property name="left-attach">0</property>
-                    <property name="top-attach">1</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkFrame" id="selectframe">
                 <property name="visible">True</property>
@@ -319,6 +264,21 @@
                     <property name="margin-top">6</property>
                     <property name="hexpand">True</property>
                     <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkEntry" id="filter">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="activates-default">True</property>
+                        <property name="truncate-multiline">True</property>
+                        <property name="placeholder-text" translatable="yes" 
context="fldrefpage|filter">Filter Selection</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkScrolledWindow">
                         <property name="visible">True</property>
@@ -361,7 +321,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
@@ -406,7 +366,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
@@ -414,6 +374,7 @@
                 <child type="label">
                   <object class="GtkLabel" id="label2">
                     <property name="can-focus">False</property>
+                    <property name="visible">True</property>
                     <property name="label" translatable="yes" 
context="fldrefpage|label2">S_election</property>
                     <property name="use-underline">True</property>
                     <property name="xalign">0</property>
@@ -426,9 +387,12 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="position">0</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
             <child>
               <!-- n-columns=2 n-rows=2 -->
               <object class="GtkGrid" id="grid1">
@@ -438,7 +402,7 @@
                 <property name="row-spacing">6</property>
                 <property name="column-spacing">12</property>
                 <child>
-                  <object class="GtkLabel" id="valueft">
+                  <object class="GtkLabel" id="fldrefvalueft">
                     <property name="visible">True</property>
                     <property name="sensitive">False</property>
                     <property name="can-focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui 
b/sw/uiconfig/swriter/ui/fldvarpage.ui
index 06394222e6cc..c43f55278d9b 100644
--- a/sw/uiconfig/swriter/ui/fldvarpage.ui
+++ b/sw/uiconfig/swriter/ui/fldvarpage.ui
@@ -65,7 +65,7 @@
         <property name="row-spacing">6</property>
         <property name="column-spacing">6</property>
         <child>
-          <object class="GtkLabel" id="nameft">
+          <object class="GtkLabel" id="fldvarnameft">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="halign">start</property>
@@ -98,7 +98,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="valueft">
+          <object class="GtkLabel" id="fldvarvalueft">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="halign">start</property>
@@ -491,6 +491,7 @@
                         <property name="visible">True</property>
                         <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="fldvarpage|label5">_Up to level:</property>
+                        <property name="mnemonic-widget">level</property>
                         <property name="use-underline">True</property>
                         <property name="xalign">0</property>
                       </object>

Reply via email to