summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-12-30 15:54:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-12-30 15:56:28 +0000
commita73475cecdac393b40c34770be65be40bf05e011 (patch)
tree152bde6a97db82df7e628a0743f66f7741290680 /vcl
parent11d0c28601dc89c48e67a7b39ba82dd52e660334 (diff)
DockingWindow will need a timer after all
to update layout after initial show when contents change Change-Id: I8edbe84fa366cdb04dbfe5e479dc01cbf04dbf4c
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dockwin.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 95dd54b0400b..6d9186eca6ec 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -329,6 +329,10 @@ void DockingWindow::ImplInitDockingWindowData()
mbIsCalculatingInitialLayoutSize = false;
mbInitialLayoutDone = false;
mpDialogParent = NULL;
+
+ //To-Do, reuse maResizeTimer
+ maLayoutIdle.SetPriority(VCL_IDLE_PRIORITY_RESIZE);
+ maLayoutIdle.SetIdleHdl( LINK( this, DockingWindow, ImplHandleLayoutTimerHdl ) );
}
void DockingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle )
@@ -1078,6 +1082,8 @@ bool DockingWindow::isLayoutEnabled() const
void DockingWindow::setOptimalLayoutSize()
{
+ maLayoutIdle.Stop();
+
//resize DockingWindow to fit requisition on initial show
Window *pBox = GetWindow(WINDOW_FIRSTCHILD);
@@ -1121,4 +1127,30 @@ Size DockingWindow::GetOptimalSize() const
return Window::CalcWindowSize(aSize);
}
+void DockingWindow::queue_resize(StateChangedType /*eReason*/)
+{
+ if (hasPendingLayout() || isCalculatingInitialLayoutSize())
+ return;
+ if (!isLayoutEnabled())
+ return;
+ WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
+ pWindowImpl->mnOptimalWidthCache = -1;
+ pWindowImpl->mnOptimalHeightCache = -1;
+ maLayoutIdle.Start();
+}
+
+IMPL_LINK(DockingWindow, ImplHandleLayoutTimerHdl, void*, EMPTYARG)
+{
+ if (!isLayoutEnabled())
+ {
+ SAL_WARN("vcl.layout", "DockingWindow has become non-layout because extra children have been added directly to it.");
+ return 0;
+ }
+
+ Window *pBox = GetWindow(WINDOW_FIRSTCHILD);
+ assert(pBox);
+ setPosSizeOnContainee(GetSizePixel(), *pBox);
+ return 0;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */