summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2017-02-14 12:08:03 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-02-24 08:58:58 +0000
commit3422dfc1b61c15d7d3a6b0e1ee16c50457946cc0 (patch)
treef9859409ebf5efa62d1d360922fbc42d5857d47a /vcl/source/control
parentc2a9e9abdc3df4a9e5bf5e3fc43a73d5847996ac (diff)
Notebookbar: Better resize support
Change-Id: I0bb5a5600be60a68e53132f2c3c42f79c958b2b3 Reviewed-on: https://gerrit.libreoffice.org/34491 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/notebookbar.cxx15
-rw-r--r--vcl/source/control/tabctrl.cxx6
2 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index 6f4108d1e9e4..453236012c21 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -105,6 +105,21 @@ void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P
VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight));
}
+void NotebookBar::Resize()
+{
+ if(m_pUIBuilder && m_pUIBuilder->get_widget_root())
+ {
+ vcl::Window* pWindow = m_pUIBuilder->get_widget_root()->GetChild(0);
+ if (pWindow)
+ {
+ Size aSize = pWindow->GetSizePixel();
+ aSize.Width() = GetSizePixel().Width();
+ pWindow->SetSizePixel(aSize);
+ }
+ }
+ Control::Resize();
+}
+
void NotebookBar::SetIconClickHdl(Link<NotebookBar*, void> aHdl)
{
if (m_pContextContainer)
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 989da8fd451d..5268fbd4cd97 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2273,13 +2273,19 @@ void NotebookbarTabControl::SelectTabPage( sal_uInt16 nPageId )
if ( nPageId == 1 )
m_aIconClickHdl.Call( static_cast<NotebookBar*>(GetParent()) );
else
+ {
TabControl::SelectTabPage( nPageId );
+ Resize();
+ }
}
void NotebookbarTabControl::SetCurPageId( sal_uInt16 nPageId )
{
if ( nPageId != 1 )
+ {
TabControl::SetCurPageId( nPageId );
+ Resize();
+ }
if ( nPageId == GetPageCount() )
ImplActivateTabPage( true );
}