chart2/uiconfig/ui/chartcolorpalettepopup.ui |   16 ++++------------
 chart2/uiconfig/ui/tp_ChartColorPalette.ui   |   12 ------------
 2 files changed, 4 insertions(+), 24 deletions(-)

New commits:
commit 533e781af8742f666bfa029b80881a77d4e19457
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Aug 29 14:54:25 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Sep 3 22:57:07 2025 +0200

    a11y: Set mnemonic widget instead of a11y relations
    
    ... for chart color palette popup.
    
    Set the GtkLabel's "mnemonic-widget" instead of manually
    setting the a11y label-for and labelled-by relations.
    Setting the mnemonic widget results in the a11y relations
    getting set as well, so there is no need to do that
    manually, and setting the mnemonic widget also
    allows moving the focus to the widget by using the
    corresponding keyboard shortcut
    
    Sample steps to trigger this color palette popup:
    
    * start Writer
    * click the "Insert Chart" toolbar item to insert
      a chart
    * click on a bar in the chart
    * open the sidebar and switch to the "Properties" deck
    * click the button in the "Colors" section
    
    Change-Id: Ic09da1c203d7e4bbee9cc99675943481723e2394
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190370
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/chart2/uiconfig/ui/chartcolorpalettepopup.ui 
b/chart2/uiconfig/ui/chartcolorpalettepopup.ui
index cf5265795d69..78b60674a9bf 100644
--- a/chart2/uiconfig/ui/chartcolorpalettepopup.ui
+++ b/chart2/uiconfig/ui/chartcolorpalettepopup.ui
@@ -44,12 +44,11 @@
                 <property name="can-focus">False</property>
                 <property name="margin-bottom">1</property>
                 <property name="label" translatable="yes" 
context="chartcolorpalettepopup|colorfulwin">Colorful</property>
+                <property name="use-underline">True</property>
+                <property name="mnemonic-widget">colorful_palettes</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
                 </attributes>
-                <accessibility>
-                  <relation type="label-for" target="colorful_palettes"/>
-                </accessibility>
               </object>
               <packing>
                 <property name="left-attach">0</property>
@@ -77,9 +76,6 @@
                     <property name="column-spacing">0</property>
                     <property name="item-padding">4</property>
                     <property name="activate-on-single-click">True</property>
-                    <accessibility>
-                      <relation type="labelled-by" target="label1"/>
-                    </accessibility>
                   </object>
                 </child>
               </object>
@@ -95,12 +91,11 @@
                 <property name="margin-top">6</property>
                 <property name="margin-bottom">1</property>
                 <property name="label" translatable="yes" 
context="chartcolorpalettepopup|monochromaticwin">Monochromatic</property>
+                <property name="use-underline">True</property>
+                <property 
name="mnemonic-widget">monochromatic_palettes</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
                 </attributes>
-                <accessibility>
-                  <relation type="label-for" target="monochromatic_palettes"/>
-                </accessibility>
               </object>
               <packing>
                 <property name="left-attach">0</property>
@@ -128,9 +123,6 @@
                     <property name="column-spacing">0</property>
                     <property name="item-padding">4</property>
                     <property name="activate-on-single-click">True</property>
-                    <accessibility>
-                      <relation type="labelled-by" target="label2"/>
-                    </accessibility>
                   </object>
                 </child>
               </object>
commit 82ab71bfd8b44ee2f98ba4eb407b49e6b689be95
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Aug 29 13:58:35 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Sep 3 22:56:57 2025 +0200

    a11y: Drop manual a11y relations for chart color palettes
    
        commit a26c93a6305bed437ab505713950858893db519d
        Date:   Sun Aug 10 22:33:37 2025 +0200
    
            chart color palettes: switch from drawingarea to IconView
    
    had switched to using weld::IconView for the color
    palettes and introduced explicitly setting the label-for
    and labelled-by accessible relations for the GtkFrame's
    internal label child and the GtkIconView.
    
    However, since the text of the GtkFrame's label is already
    used as the accessible name for the frame and that one is the
    parent "panel" of the IconView, screen readers already announce
    the accessible name of the parent when the IconView receives
    focus.
    
    For gtk3, this would result in the label text/accessible name
    getting announced twice now, e.g. "Colorful Colorful, list with
    N items".
    Similarly, NVDA on Windows would say "Colorful option pane, Colorful
    list".
    
    Stop explicitly setting the a11y relations to have it announced
    only once.
    
    An alternative solution could be to stop using a GtkFrame and
    using a simple GtkLabel, then setting the GtkIconView as its
    mnemonic widget.
    
    Sample steps to see the corresponding dialog page:
    
    * start Writer
    * click the "Insert Chart" toolbar item to insert
      a chart
    * double-click on a bar in the chart
    * switch to the "Color Palette" tab page
    
    Change-Id: If3a2beac193f05e13cc0fb1b30d6d0486c8433e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190369
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/chart2/uiconfig/ui/tp_ChartColorPalette.ui 
b/chart2/uiconfig/ui/tp_ChartColorPalette.ui
index f79e1b9b3e8e..2a4a5bd02ec8 100644
--- a/chart2/uiconfig/ui/tp_ChartColorPalette.ui
+++ b/chart2/uiconfig/ui/tp_ChartColorPalette.ui
@@ -53,9 +53,6 @@
                 <property name="column-spacing">0</property>
                 <property name="item-padding">4</property>
                 <property name="activate-on-single-click">True</property>
-                <accessibility>
-                  <relation type="labelled-by" target="LBL_COLORFUL"/>
-                </accessibility>
               </object>
             </child>
           </object>
@@ -69,9 +66,6 @@
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
-            <accessibility>
-              <relation type="label-for" target="colorful_palettes"/>
-            </accessibility>
           </object>
         </child>
       </object>
@@ -111,9 +105,6 @@
                 <property name="column-spacing">0</property>
                 <property name="item-padding">4</property>
                 <property name="activate-on-single-click">True</property>
-                <accessibility>
-                  <relation type="labelled-by" target="LBL_MONOCHROMATIC"/>
-                </accessibility>
               </object>
             </child>
           </object>
@@ -127,9 +118,6 @@
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
-            <accessibility>
-              <relation type="label-for" target="monochromatic_palettes"/>
-            </accessibility>
           </object>
         </child>
       </object>

Reply via email to