diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-30 14:44:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-30 16:09:56 +0100 |
commit | a48cf78fab4a283ef43c091e8c324c968377f9db (patch) | |
tree | 53e1317b48d82d7df1c7ace695eaa6391aa45079 /vcl | |
parent | dbd6ae7dfdd292f049bbed5beb659f99e963c47b (diff) |
merge queue_layout and queue_resize
so that any window derived class, and not just dialogs, can trigger layouting
of their children. Merge together the handful of hacked-up impls of this.
Do that then for the sidebar PanelLayout so that when the label of the custom
animation frame changes that the frame allocates enough space for the new label
to display fully
Change-Id: I9a95f6c3f60cd6cea47656e66cb9ffcc154a3a5a
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 20 |
4 files changed, 17 insertions, 19 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 3504b900c0c0..93ee0cdbabcc 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2361,4 +2361,10 @@ Size TabControl::GetOptimalSize() const return calculateRequisition(); } +void TabControl::queue_resize() +{ + markLayoutDirty(); + Window::queue_resize(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index ef14a796970d..17f0e37492aa 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1254,7 +1254,7 @@ IMPL_LINK( Dialog, ImplHandleLayoutTimerHdl, void*, EMPTYARG ) return 0; } -void Dialog::queue_layout() +void Dialog::queue_resize() { if (hasPendingLayout() || isCalculatingInitialLayoutSize()) return; @@ -1267,7 +1267,7 @@ void Dialog::queue_layout() void Dialog::Resize() { - queue_layout(); + queue_resize(); } bool Dialog::set_property(const OString &rKey, const OString &rValue) diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index e7f5e1b9c867..dff2546fc18c 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -156,6 +156,12 @@ void VclContainer::SetSizePixel(const Size& rAllocation) } } +void VclContainer::queue_resize() +{ + markLayoutDirty(); + Window::queue_resize(); +} + void VclBox::accumulateMaxes(const Size &rChildSize, Size &rSize) const { long nSecondaryChildDimension = getSecondaryDimension(rChildSize); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index aa919519995c..475181cc4373 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1732,34 +1732,20 @@ namespace { bool bSomeoneCares = false; - Dialog *pDialog = NULL; - - Window *pWindow = pOrigWindow; - - while (pWindow) + Window *pWindow = pOrigWindow->GetParent(); + if (pWindow) { if (isContainerWindow(*pWindow)) { - VclContainer *pContainer = static_cast<VclContainer*>(pWindow); - pContainer->markLayoutDirty(); bSomeoneCares = true; } else if (pWindow->GetType() == WINDOW_TABCONTROL) { - TabControl *pTabControl = static_cast<TabControl*>(pWindow); - pTabControl->markLayoutDirty(); bSomeoneCares = true; } - else if (pWindow->IsDialog()) - { - pDialog = dynamic_cast<Dialog*>(pWindow); - break; - } - pWindow = pWindow->GetParent(); + pWindow->queue_resize(); } - if (pDialog && pDialog != pOrigWindow) - pDialog->queue_layout(); return bSomeoneCares; } } |