summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-04-22 12:44:00 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2017-04-22 13:50:57 +0200
commit055ae711eff085ff6b9db8f47c3193016d0db81e (patch)
tree97a2640bbefec5d04733f9fcf94f3b1317fb28fd /sfx2
parentd22bcb3867b2c61c11b5a563dcc5cf122d31bbff (diff)
Notebookbar: better tab placing for the NotebookbarTabControl
Change-Id: Ia44ce20455829048be457584c49fde0996f4a699 Reviewed-on: https://gerrit.libreoffice.org/36814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/notebookbar/NotebookbarTabControl.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
index e2acfb5ea2c4..3c8f2058e18f 100644
--- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx
+++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
@@ -19,6 +19,7 @@
#include <vcl/builderfactory.hxx>
#include <vcl/layout.hxx>
+#include <vcl/tabpage.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/notebookbar/NotebookbarTabControl.hxx>
#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
@@ -260,6 +261,29 @@ IMPL_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebo
}
}
+Size NotebookbarTabControl::calculateRequisition() const
+{
+ Size aSize = NotebookbarTabControlBase::calculateRequisition();
+
+ for (int i = 0; i < GetPageCount(); i++)
+ {
+ vcl::Window* pChild = static_cast<vcl::Window*>(GetTabPage(TabControl::GetPageId(i)));
+
+ if (pChild)
+ {
+ Size aChildSize = VclAlignment::getLayoutRequisition(*pChild);
+
+ if (aChildSize.getWidth() < aSize.getWidth())
+ aSize.Width() = aChildSize.Width();
+ }
+ }
+
+ if (aSize.Width() < 400)
+ aSize.Width() = 400;
+
+ return aSize;
+}
+
VCL_BUILDER_FACTORY( NotebookbarTabControl )
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */