summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-30 14:18:29 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-10-08 11:46:15 +0200
commit0784008e111efbc9e66f91fc97ecbe4407fd970f (patch)
tree68fa6b543255717ae32e97537f0dab8014886628 /cui
parentRelated: tdf#127645 update dialog has a slave extension dialog (diff)
downloadcore-0784008e111efbc9e66f91fc97ecbe4407fd970f.tar.gz
core-0784008e111efbc9e66f91fc97ecbe4407fd970f.zip
autocorrect dialog width grows on change of new to replace
the sizegroup isn't working as I'd expect, so just make the replace button visible, get the preferred width of the buttonbox, lock that down then hide the place button and the container will stay at the max width that will be wanted Change-Id: Idfe632aa5af404abb92fc8f7267f0dda5cdbe295 Reviewed-on: https://gerrit.libreoffice.org/79863 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/autocdlg.hxx1
-rw-r--r--cui/source/tabpages/autocdlg.cxx8
-rw-r--r--cui/uiconfig/ui/acorreplacepage.ui11
3 files changed, 11 insertions, 9 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index bcb283f154e6..cf97ece51d7f 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -188,6 +188,7 @@ private:
std::unique_ptr<weld::Button> m_xNewReplacePB;
std::unique_ptr<weld::Button> m_xReplacePB;
std::unique_ptr<weld::Button> m_xDeleteReplacePB;
+ std::unique_ptr<weld::Container> m_xButtonBox;
DECL_LINK(SelectHdl, weld::TreeView&, void);
DECL_LINK(NewDelButtonHdl, weld::Button&, void);
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 6573e3b43e0b..aa299fb3ca46 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -669,9 +669,17 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage(TabPageParent pParent,
, m_xNewReplacePB(m_xBuilder->weld_button("new"))
, m_xReplacePB(m_xBuilder->weld_button("replace"))
, m_xDeleteReplacePB(m_xBuilder->weld_button("delete"))
+ , m_xButtonBox(m_xBuilder->weld_container("buttonbox"))
{
sNew = m_xNewReplacePB->get_label();
sModify = m_xReplacePB->get_label();
+
+ // lock down the width of the button box to its max
+ // desired width
+ auto nMaxWidth = m_xButtonBox->get_preferred_size().Width();
+ m_xButtonBox->set_size_request(nMaxWidth, -1);
+ m_xReplacePB->hide();
+
// tdf#125348 set some small but fixed initial width size, final width will
// depend on the size of the entry boxes
m_xReplaceTLB->set_size_request(42, m_xReplaceTLB->get_height_rows(10));
diff --git a/cui/uiconfig/ui/acorreplacepage.ui b/cui/uiconfig/ui/acorreplacepage.ui
index 36808eb4ec4d..b099bf079991 100644
--- a/cui/uiconfig/ui/acorreplacepage.ui
+++ b/cui/uiconfig/ui/acorreplacepage.ui
@@ -21,12 +21,11 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkButtonBox" id="buttonbox1">
+ <object class="GtkBox" id="buttonbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
- <property name="layout_style">start</property>
<child>
<object class="GtkButton" id="new">
<property name="label">gtk-new</property>
@@ -45,6 +44,7 @@
<child>
<object class="GtkButton" id="replace">
<property name="label" translatable="yes" context="acorreplacepage|replace">_Replace</property>
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
@@ -233,11 +233,4 @@
<placeholder/>
</child>
</object>
- <object class="GtkSizeGroup" id="sizegroup1">
- <widgets>
- <widget name="new"/>
- <widget name="replace"/>
- <widget name="delete"/>
- </widgets>
- </object>
</interface>