diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-27 17:19:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-27 20:25:04 +0200 |
commit | fc5856263439846c9e692e1ccaddf3312530b1a2 (patch) | |
tree | c57010b763f533a193eecf4cdade3bb7c3d846ce | |
parent | c156fc0b844d6d7e31dc5b6a5e12ef71d8f631c8 (diff) |
lock the combobox + spinbutton group width to its original all-shown width
so the notebook page contents don't jump around when the spinbox is
hidden/shown
Change-Id: Ib6ad47644b55d857dae972340444d7bac67278e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122724
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/inc/border.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/border.cxx | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index 2a3d14ed5062..433ab7425e5c 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -129,6 +129,7 @@ private: std::unique_ptr<SvtLineListBox> m_xLbLineStyle; std::unique_ptr<ColorListBox> m_xLbLineColor; + std::unique_ptr<weld::Widget> m_xLineWidthGroup; std::unique_ptr<weld::ComboBox> m_xLineWidthLB; std::unique_ptr<weld::MetricSpinButton> m_xLineWidthMF; diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 70ec64c1a3bc..59ecc1cfd2ee 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -294,6 +294,7 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, weld::DialogControlle , m_xLbLineStyle(new SvtLineListBox(m_xBuilder->weld_menu_button("linestylelb"))) , m_xLbLineColor(new ColorListBox(m_xBuilder->weld_menu_button("linecolorlb"), [this]{ return GetDialogController()->getDialog(); })) + , m_xLineWidthGroup(m_xBuilder->weld_widget("gridlinewidth")) , m_xLineWidthLB(m_xBuilder->weld_combo_box("linewidthlb")) , m_xLineWidthMF(m_xBuilder->weld_metric_spin_button("linewidthmf", FieldUnit::POINT)) , m_xSpacingFrame(m_xBuilder->weld_container("spacing")) @@ -524,6 +525,12 @@ SvxBorderTabPage::SvxBorderTabPage(weld::Container* pPage, weld::DialogControlle m_xWndPresets->SetSelectHdl( LINK( this, SvxBorderTabPage, SelPreHdl_Impl ) ); m_xWndShadows->SetSelectHdl( LINK( this, SvxBorderTabPage, SelSdwHdl_Impl ) ); + // lock the group to its original width where both widgets are shown so the + // notebook page contents don't jump around when the spinbox is + // hidden/shown + Size aOrigGroupSize(m_xLineWidthGroup->get_preferred_size()); + m_xLineWidthGroup->set_size_request(aOrigGroupSize.Width(), -1); + FillValueSets(); FillLineListBox_Impl(); |