diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-26 19:48:54 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-27 09:53:20 +0100 |
commit | 37f5f9896449c6e2cb9aa481f004cd887672d2ed (patch) | |
tree | 08d64e511b9d642b5c7711fba9c1ae6cf6d34090 /svx/source/dialog/dlgctrl.cxx | |
parent | 960bc8553328c6bfb8818094195e0f737eb013a9 (diff) |
tdf#130197 give paragraph and table panels column widths of 5 toolbutton widths
Change-Id: Iae4f10eef6b293731d22eec8dcbb85a07d3e6c11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87462
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/dialog/dlgctrl.cxx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index b23970a82b61..c9cb58ca1594 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -22,6 +22,7 @@ #include <vcl/virdev.hxx> #include <vcl/event.hxx> #include <sfx2/dialoghelper.hxx> +#include <sfx2/weldutils.hxx> #include <svx/relfld.hxx> #include <svx/xlineit0.hxx> #include <svx/xtable.hxx> @@ -1465,4 +1466,23 @@ void limitWidthForSidebar(RelativeField& rMetricSpinButton) limitWidthForSidebar(rSpinButton); } +void padWidthForSidebar(weld::Toolbar& rToolbar, const css::uno::Reference<css::frame::XFrame>& rFrame) +{ + static int nColumnWidth = -1; + static vcl::ImageType eSize; + if (nColumnWidth != -1 && eSize != rToolbar.get_icon_size()) + nColumnWidth = -1; + if (nColumnWidth == -1) + { + // use the, filled-in by dispatcher, width of measurewidth as the width + // of a "standard" column in a two column panel + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(&rToolbar, "svx/ui/measurewidthbar.ui")); + std::unique_ptr<weld::Toolbar> xToolbar(xBuilder->weld_toolbar("measurewidth")); + std::unique_ptr<ToolbarUnoDispatcher> xDispatcher(new ToolbarUnoDispatcher(*xToolbar, rFrame)); + nColumnWidth = xToolbar->get_preferred_size().Width(); + eSize = rToolbar.get_icon_size(); + } + rToolbar.set_size_request(nColumnWidth, -1); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |