diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-15 09:21:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-15 11:56:09 +0100 |
commit | 65ecb0d8f43f99f3794fe1aa19c87c153534fbf2 (patch) | |
tree | 61dc4dd87e68520eee49be0a47d713e0cfed5c1b | |
parent | 835c9e6d842fb726e11afee032ef1d25d28efd58 (diff) |
Related: fdo#80633 we can retain cached size for visibility change
we still need to invalidate the layout of our parents, but we can
keep the cached optimal size
Change-Id: I8e77366bd61ff45d34f9d411c7f501a3a9ccbd4e
-rw-r--r-- | cui/source/inc/treeopt.hxx | 2 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 2 | ||||
-rw-r--r-- | include/svtools/wizdlg.hxx | 2 | ||||
-rw-r--r-- | include/svx/sidebar/PanelLayout.hxx | 2 | ||||
-rw-r--r-- | include/vcl/dialog.hxx | 2 | ||||
-rw-r--r-- | include/vcl/layout.hxx | 2 | ||||
-rw-r--r-- | include/vcl/tabctrl.hxx | 2 | ||||
-rw-r--r-- | include/vcl/window.hxx | 3 | ||||
-rw-r--r-- | svtools/source/dialogs/wizdlg.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/PanelLayout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 9 |
15 files changed, 24 insertions, 20 deletions
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx index e698653efa56..d8077d2fe51a 100644 --- a/cui/source/inc/treeopt.hxx +++ b/cui/source/inc/treeopt.hxx @@ -189,7 +189,7 @@ private: VectorOfNodes LoadNodes( Module* pModule, const OUString& rExtensionId ); void InsertNodes( const VectorOfNodes& rNodeList ); - virtual void queue_resize() SAL_OVERRIDE; + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT) SAL_OVERRIDE; void SetPaneSize(Window *pPane); protected: diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index ed363cce9f2a..5817013a8136 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -934,7 +934,7 @@ bool OfaTreeOptionsDialog::hasTreePendingLayout() const return maTreeLayoutTimer.IsActive(); } -void OfaTreeOptionsDialog::queue_resize() +void OfaTreeOptionsDialog::queue_resize(StateChangedType /*eReason*/) { if (hasTreePendingLayout()) return; diff --git a/include/svtools/wizdlg.hxx b/include/svtools/wizdlg.hxx index 8d26dc40305c..4efca16599ad 100644 --- a/include/svtools/wizdlg.hxx +++ b/include/svtools/wizdlg.hxx @@ -264,7 +264,7 @@ public: virtual void ActivatePage(); virtual long DeactivatePage(); - virtual void queue_resize() SAL_OVERRIDE; + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT) SAL_OVERRIDE; bool ShowPrevPage(); bool ShowNextPage(); diff --git a/include/svx/sidebar/PanelLayout.hxx b/include/svx/sidebar/PanelLayout.hxx index 3dc4bfcee18d..13b6086b63fd 100644 --- a/include/svx/sidebar/PanelLayout.hxx +++ b/include/svx/sidebar/PanelLayout.hxx @@ -36,7 +36,7 @@ public: virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL) SAL_OVERRIDE; - virtual void queue_resize() SAL_OVERRIDE; + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT) SAL_OVERRIDE; }; diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index 8776ec0cc465..27c79e1c6d3d 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -104,7 +104,7 @@ public: bool isLayoutEnabled() const; void setOptimalLayoutSize(); bool isCalculatingInitialLayoutSize() const { return mbIsCalculatingInitialLayoutSize; } - virtual void queue_resize() SAL_OVERRIDE; + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT) SAL_OVERRIDE; virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; VclButtonBox* get_action_area() { return mpActionArea;} VclBox* get_content_area() { return mpContentArea;} diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index b05458361fb4..a68103802e06 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -40,7 +40,7 @@ public: m_bLayoutDirty = true; } - virtual void queue_resize() SAL_OVERRIDE; + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT) SAL_OVERRIDE; protected: //these are the two that need to be implemented by //containers, figure out how much space you want... diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx index 81057996b3ee..00e3a06974ea 100644 --- a/include/vcl/tabctrl.hxx +++ b/include/vcl/tabctrl.hxx @@ -193,7 +193,7 @@ public: mbLayoutDirty = true; } - virtual void queue_resize() SAL_OVERRIDE; + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT) SAL_OVERRIDE; }; #endif // INCLUDED_VCL_TABCTRL_HXX diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 2d68c7ae19e8..40ea0095d165 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -247,6 +247,7 @@ typedef sal_uInt16 StateChangedType; #define STATE_CHANGE_READONLY ((StateChangedType)16) #define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)17) #define STATE_CHANGE_MIRRORING ((StateChangedType)18) +#define STATE_CHANGE_LAYOUT ((StateChangedType)19) #define STATE_CHANGE_CONTROL_FOCUS ((StateChangedType)20) #define STATE_CHANGE_USER ((StateChangedType)10000) @@ -1201,7 +1202,7 @@ public: * * akin to gtk_widget_queue_resize */ - virtual void queue_resize(); + virtual void queue_resize(StateChangedType eReason = STATE_CHANGE_LAYOUT); /* * Sets the "width-request" property diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index 50af1980f764..51bd143a3a09 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -119,7 +119,7 @@ bool WizardDialog::hasWizardPendingLayout() const return maWizardLayoutTimer.IsActive(); } -void WizardDialog::queue_resize() +void WizardDialog::queue_resize(StateChangedType /*eReason*/) { if (hasWizardPendingLayout()) return; diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index 9635fcc512e1..04a62186f912 100644 --- a/svx/source/sidebar/PanelLayout.cxx +++ b/svx/source/sidebar/PanelLayout.cxx @@ -43,7 +43,7 @@ bool PanelLayout::hasPanelPendingLayout() const return m_aPanelLayoutTimer.IsActive(); } -void PanelLayout::queue_resize() +void PanelLayout::queue_resize(StateChangedType /*eReason*/) { if (m_bInClose) return; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 6148a950d3e4..cb21606df3ee 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2224,10 +2224,10 @@ Size TabControl::GetOptimalSize() const return calculateRequisition(); } -void TabControl::queue_resize() +void TabControl::queue_resize(StateChangedType eReason) { markLayoutDirty(); - Window::queue_resize(); + Window::queue_resize(eReason); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 87d9d77f674d..ef315da58934 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1230,7 +1230,7 @@ IMPL_LINK( Dialog, ImplHandleLayoutTimerHdl, void*, EMPTYARG ) return 0; } -void Dialog::queue_resize() +void Dialog::queue_resize(StateChangedType /*eReason*/) { if (hasPendingLayout() || isCalculatingInitialLayoutSize()) return; diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 5ae34120ad43..21e49f58fd55 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -157,10 +157,10 @@ void VclContainer::SetSizePixel(const Size& rAllocation) } } -void VclContainer::queue_resize() +void VclContainer::queue_resize(StateChangedType eReason) { markLayoutDirty(); - Window::queue_resize(); + Window::queue_resize(eReason); } void VclBox::accumulateMaxes(const Size &rChildSize, Size &rSize) const diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 469933829ec3..b7166f0390d8 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1984,7 +1984,7 @@ void Window::Tracking( const TrackingEvent& rTEvt ) pWrapper->Tracking( rTEvt ); } -void Window::StateChanged( StateChangedType eType ) +void Window::StateChanged(StateChangedType eType) { switch (eType) { @@ -2002,7 +2002,7 @@ void Window::StateChanged( StateChangedType eType ) break; //stuff that does invalidate the layout default: - queue_resize(); + queue_resize(eType); break; } } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 52ccd629f6b0..cabf358f094c 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1423,13 +1423,16 @@ namespace } } -void Window::queue_resize() +void Window::queue_resize(StateChangedType eReason) { bool bSomeoneCares = queue_ungrouped_resize(this); WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; - pWindowImpl->mnOptimalWidthCache = -1; - pWindowImpl->mnOptimalHeightCache = -1; + if (eReason != STATE_CHANGE_VISIBLE) + { + pWindowImpl->mnOptimalWidthCache = -1; + pWindowImpl->mnOptimalHeightCache = -1; + } if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VCL_SIZE_GROUP_NONE) { std::set<Window*> &rWindows = pWindowImpl->m_xSizeGroup->get_widgets(); |