summaryrefslogtreecommitdiff
path: root/svx/source/sidebar/paragraph
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-17 13:44:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-17 22:06:22 +0100
commit16bbfcd1902e63823f6f1a491442b82024def2bc (patch)
tree6b2663ee1394604b2c9f4d6b5694535e20d812b1 /svx/source/sidebar/paragraph
parent00710aebdf339415f1fa2072ef6a76c8bb6a591a (diff)
limit table spinbuttons width for sidebar
to the same width as the paragraph sidebar spinbuttons Change-Id: I980545b4186b25cb5ada473095ece8c77f99420a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86992 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/sidebar/paragraph')
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx31
1 files changed, 6 insertions, 25 deletions
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index e22cd4bbda27..0a01b42a8654 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -26,6 +26,7 @@
#include <editeng/ulspitem.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
+#include <svx/dlgctrl.hxx>
#include <svx/svxids.hrc>
#include <svl/intitem.hxx>
#include <sfx2/objsh.hxx>
@@ -401,18 +402,6 @@ FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolI
return eUnit;
}
-namespace
-{
- void limitWidth(RelativeField& rMetricSpinButton)
- {
- // space is limited in the sidebar, so limit MetricSpinButtons to a width of 4 digits
- const int nMaxDigits = 4;
-
- weld::SpinButton& rSpinButton = rMetricSpinButton.get_widget();
- rSpinButton.set_width_chars(std::min(rSpinButton.get_width_chars(), nMaxDigits));
- }
-}
-
ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -456,25 +445,17 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
mpBindings(pBindings),
mxSidebar(rxSidebar)
{
-#if 0
- mxTopDist->set_size_request(mxTopDist->get_preferred_size().Width(), -1);
- mxBottomDist->set_size_request(mxBottomDist->get_preferred_size().Width(), -1);
- mxLeftIndent->set_size_request(mxLeftIndent->get_preferred_size().Width(), -1);
- mxRightIndent->set_size_request(mxRightIndent->get_preferred_size().Width(), -1);
- mxFLineIndent->set_size_request(mxFLineIndent->get_preferred_size().Width(), -1);
-#endif
-
initial();
m_aMetricCtl.RequestUpdate();
}
void ParaPropertyPanel::limitMetricWidths()
{
- limitWidth(*mxTopDist);
- limitWidth(*mxBottomDist);
- limitWidth(*mxLeftIndent);
- limitWidth(*mxRightIndent);
- limitWidth(*mxFLineIndent);
+ limitWidthForSidebar(*mxTopDist);
+ limitWidthForSidebar(*mxBottomDist);
+ limitWidthForSidebar(*mxLeftIndent);
+ limitWidthForSidebar(*mxRightIndent);
+ limitWidthForSidebar(*mxFLineIndent);
}
ParaPropertyPanel::~ParaPropertyPanel()