diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-01-04 18:09:20 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-01-06 19:16:28 +0100 |
commit | 5b77d17c4f1ca734babf962b45c1aa07bdca14e9 (patch) | |
tree | 7ea5542a677748273d2c95cbd3ab1514a4b876f1 /include | |
parent | 0bb6bb7729f159f05100e33797ed667fd9d13ab7 (diff) |
sidebar: allow panels to lurk around instead of being disposed.
Creating and destroying sidebar panels is done remarkably often - on
changes of context eg. The process is remarkably expensive - loading
UI XML files, processing them etc. and is un-necessary.
Instead let panels lurk around for future use - particularly in the
Properties deck which gets the most thrash. This gives a big speedup
particularly noticable on mobile where it could take several seconds
to load switch between panels for eg. shape vs. slide properties when
tapping to edit text.
Change-Id: I497e77432c11bbd1e35a8a8716519cabc3730e61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86233
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86287
Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/sidebar/Panel.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sfx2/sidebar/Panel.hxx b/include/sfx2/sidebar/Panel.hxx index 823ed6e90a3a..2c0e9bd764c2 100644 --- a/include/sfx2/sidebar/Panel.hxx +++ b/include/sfx2/sidebar/Panel.hxx @@ -58,6 +58,10 @@ public: const OUString& GetId() const { return msPanelId;} void TriggerDeckLayouting() { maDeckLayoutTrigger(); } + /// Set whether a panel should be present but invisible / inactive + void SetLurkMode(bool bLurk); + bool IsLurking() const { return mbLurking; } + virtual void Resize() override; virtual void DataChanged (const DataChangedEvent& rEvent) override; virtual void ApplySettings(vcl::RenderContext& rRenderContext) override; @@ -70,6 +74,7 @@ private: css::uno::Reference<css::ui::XUIElement> mxElement; css::uno::Reference<css::ui::XSidebarPanel> mxPanelComponent; bool mbIsExpanded; + bool mbLurking; const std::function<void()> maDeckLayoutTrigger; const std::function<Context()> maContextAccess; |