summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/Panel.cxx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-05-08 09:48:36 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:30 +0100
commit11f8ed408d43f40de5f694d6b7d00cb7762ee84f (patch)
tree56a920759e63a3202c750cf21dc884832140e0d0 /sfx2/source/sidebar/Panel.cxx
parent5e8a2c64799856ddc34ab5d468bd54d7302302f4 (diff)
Resolves: #i122255# Store sidebar panel extension state
(non persistent) (cherry picked from commit f6f8c047b73f8fc8b4c78b321761a26ef7ed96ba) Change-Id: I917050dd57b3fa952200dd536b371f902661e88f
Diffstat (limited to 'sfx2/source/sidebar/Panel.cxx')
-rw-r--r--sfx2/source/sidebar/Panel.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 59eeb0589c2a..0840c4c5f805 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -21,6 +21,7 @@
#include "PanelDescriptor.hxx"
#include "sfx2/sidebar/Theme.hxx"
#include "Paint.hxx"
+#include "ResourceManager.hxx"
#ifdef DEBUG
#include "sfx2/sidebar/Tools.hxx"
@@ -47,7 +48,9 @@ namespace sfx2 { namespace sidebar {
Panel::Panel (
const PanelDescriptor& rPanelDescriptor,
Window* pParentWindow,
- const ::boost::function<void(void)>& rDeckLayoutTrigger)
+ const bool bIsInitiallyExpanded,
+ const ::boost::function<void(void)>& rDeckLayoutTrigger,
+ const ::boost::function<Context(void)>& rContextAccess)
: Window(pParentWindow),
msPanelId(rPanelDescriptor.msId),
mpTitleBar(new PanelTitleBar(
@@ -57,8 +60,9 @@ Panel::Panel (
mbIsTitleBarOptional(rPanelDescriptor.mbIsTitleBarOptional),
mxElement(),
mxPanelComponent(),
- mbIsExpanded(true),
- maDeckLayoutTrigger(rDeckLayoutTrigger)
+ mbIsExpanded(bIsInitiallyExpanded),
+ maDeckLayoutTrigger(rDeckLayoutTrigger),
+ maContextAccess(rContextAccess)
{
SetBackground(Theme::GetPaint(Theme::Paint_PanelBackground).GetWallpaper());
@@ -153,6 +157,12 @@ void Panel::SetExpanded (const bool bIsExpanded)
{
mbIsExpanded = bIsExpanded;
maDeckLayoutTrigger();
+
+ if (maContextAccess)
+ ResourceManager::Instance().StorePanelExpansionState(
+ msPanelId,
+ bIsExpanded,
+ maContextAccess());
}
}