tdf#130857 Define widgets in Calc "Solver" dialog in order

Switch the order in which the widgets in the .ui file
are defined so that the order better matches the visual appearance
and logical order, which makes sure that tab focus order with the
Qt-based VCL plugins is correct as well when using native Qt
widgets (SAL_VCL_QT_USE_WELDED_WIDGETS=1), where
focus order is (by default) based on widget creation order.

See

    commit 02692566ad
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Oct 24 17:43:35 2024 +0200

        tdf#130857 optnewdictionarydialog.ui: Define focusable widgets in order

for more background.

The dialog can e.g. be triggered like this:

* start Calc
* insert following values into the spreadsheet:
    * A1: "1"
    * A3: "=A1"
* "Tools" -> "Solver..."

The Python script mentioned in the commit message of

    commit 327679b2fb
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Jul 8 15:50:59 2026 +0200

        tdf#130857 Define widgets in Calc "General" options page in order

was used to reorder the GtkGrid children automatically.

Change-Id: I2b510d55c1129c6d3dcbb5bcbaabbc1cf1f46af5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208597
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2026-07-28 09:59:43 +02:00
parent ec213ab97f
commit 434f2f3616
+343 -343
View File
@@ -135,130 +135,6 @@
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="result">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="solverdlg|result">Optimize result to</property>
<property name="use-underline">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<accessibility>
<relation type="label-for" target="min"/>
<relation type="label-for" target="max"/>
<relation type="label-for" target="value"/>
</accessibility>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="changelabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="solverdlg|changelabel">_By changing cells</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">changeedit</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="min">
<property name="label" translatable="yes" context="solverdlg|min">Minim_um</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
<property name="group">max</property>
<accessibility>
<relation type="labelled-by" target="result"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="min-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="solverdlg|extended_tip|min">Enter the cell range that can be changed.</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="max">
<property name="label" translatable="yes" context="solverdlg|max">_Maximum</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
<accessibility>
<relation type="labelled-by" target="result"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="max-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="solverdlg|extended_tip|max">Enter the cell range that can be changed.</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkEntry" id="changeedit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">32</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="changeedit-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="solverdlg|extended_tip|changeedit">Enter the cell range that can be changed.</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="changebutton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
@@ -302,6 +178,72 @@
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="result">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="solverdlg|result">Optimize result to</property>
<property name="use-underline">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<accessibility>
<relation type="label-for" target="min"/>
<relation type="label-for" target="max"/>
<relation type="label-for" target="value"/>
</accessibility>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="max">
<property name="label" translatable="yes" context="solverdlg|max">_Maximum</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
<accessibility>
<relation type="labelled-by" target="result"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="max-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="solverdlg|extended_tip|max">Enter the cell range that can be changed.</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="min">
<property name="label" translatable="yes" context="solverdlg|min">Minim_um</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
<property name="group">max</property>
<accessibility>
<relation type="labelled-by" target="result"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="min-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="solverdlg|extended_tip|min">Enter the cell range that can be changed.</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box5">
<property name="visible">True</property>
@@ -382,6 +324,64 @@
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="changelabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="solverdlg|changelabel">_By changing cells</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">changeedit</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkEntry" id="changeedit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">32</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="changeedit-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="solverdlg|extended_tip|changeedit">Enter the cell range that can be changed.</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="changebutton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@@ -487,63 +487,6 @@
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ref2edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">20</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ref2edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref2edit-atkobject">Cell reference</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ref3edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">20</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ref3edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref3edit-atkobject">Cell reference</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ref4edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">20</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ref4edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref4edit-atkobject">Cell reference</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref1button">
<property name="visible">True</property>
@@ -555,39 +498,6 @@
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref2button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref3button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref4button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="op1list">
<property name="visible">True</property>
@@ -610,6 +520,79 @@
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val1edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">6</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">15</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="val1edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val1edit-atkobject">Value</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val1button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes" context="solverdlg|del1|tooltip_text">Remove</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ref2edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">20</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ref2edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref2edit-atkobject">Cell reference</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref2button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="op2list">
<property name="visible">True</property>
@@ -632,6 +615,79 @@
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val2edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">6</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">15</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="val2edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val2edit-atkobject">Value</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val2button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del2">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes" context="solverdlg|del2|tooltip_text">Remove</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ref3edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">20</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ref3edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref3edit-atkobject">Cell reference</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref3button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="op3list">
<property name="visible">True</property>
@@ -654,6 +710,79 @@
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val3edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">6</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">15</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="val3edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val3edit-atkobject">Value</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val3button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del3">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes" context="solverdlg|del3|tooltip_text">Remove</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="ref4edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">20</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="ref4edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|ref4edit-atkobject">Cell reference</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ref4button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="op4list">
<property name="visible">True</property>
@@ -676,66 +805,6 @@
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val1edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">6</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">15</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="val1edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val1edit-atkobject">Value</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val2edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">6</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">15</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="val2edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val2edit-atkobject">Value</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val3edit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-start">6</property>
<property name="hexpand">True</property>
<property name="activates-default">True</property>
<property name="width-chars">15</property>
<property name="truncate-multiline">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="val3edit-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="solverdlg|val3edit-atkobject">Value</property>
</object>
</child>
</object>
<packing>
<property name="left-attach">3</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="val4edit">
<property name="visible">True</property>
@@ -756,39 +825,6 @@
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val1button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val2button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val3button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="left-attach">4</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="val4button">
<property name="visible">True</property>
@@ -800,42 +836,6 @@
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del2">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes" context="solverdlg|del2|tooltip_text">Remove</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes" context="solverdlg|del1|tooltip_text">Remove</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del3">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes" context="solverdlg|del3|tooltip_text">Remove</property>
</object>
<packing>
<property name="left-attach">5</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="del4">
<property name="visible">True</property>