diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-20 17:30:18 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-20 19:44:24 +0900 |
commit | d0f20c37747e9eaaae7642ce017a53b1f3e4b5a6 (patch) | |
tree | 431816904742b005664c6bbd4b5e22f6af38fb4f | |
parent | 56366b913289d1e3752b780db6820e1784937c2e (diff) |
Deck, TitleBar - setup background in ApplySettings
Change-Id: I3468176b8605094887f1d81ce37ef2c47719e3e7
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/sidebar/Deck.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/sidebar/TitleBar.cxx | 23 | ||||
-rw-r--r-- | sfx2/source/sidebar/TitleBar.hxx | 2 |
4 files changed, 22 insertions, 15 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index 2e2771731b01..d5dc5d30b965 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -50,8 +50,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, , mpFiller(VclPtr<vcl::Window>::Create(this)) , mpVerticalScrollBar(VclPtr<ScrollBar>::Create(this)) { - SetBackground(Wallpaper()); - mpScrollClipWindow->SetBackground(Wallpaper()); mpScrollClipWindow->Show(); @@ -111,10 +109,13 @@ Rectangle Deck::GetContentArea() const aWindowSize.Height() - 1 - Theme::GetInteger(Theme::Int_DeckBottomPadding) - nBorderSize); } -void Deck::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) +void Deck::ApplySettings(vcl::RenderContext& rRenderContext) { - (void) rUpdateArea; + rRenderContext.SetBackground(Wallpaper()); +} +void Deck::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpdateArea*/) +{ const Size aWindowSize (GetSizePixel()); const SvBorder aPadding(Theme::GetInteger(Theme::Int_DeckLeftPadding), Theme::GetInteger(Theme::Int_DeckTopPadding), diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx index 4e6f4bc2dd49..9efaadc94fed 100644 --- a/sfx2/source/sidebar/Deck.hxx +++ b/sfx2/source/sidebar/Deck.hxx @@ -64,9 +64,10 @@ public: */ void ShowPanel (const Panel& rPanel); + virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) SAL_OVERRIDE; virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE; - virtual bool Notify (NotifyEvent& rEvent) SAL_OVERRIDE; + virtual bool Notify(NotifyEvent& rEvent) SAL_OVERRIDE; static void PrintWindowSubTree (vcl::Window* pRoot, int nIndentation); diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx index da27a66e828d..fd3c1a9439b9 100644 --- a/sfx2/source/sidebar/TitleBar.cxx +++ b/sfx2/source/sidebar/TitleBar.cxx @@ -39,13 +39,12 @@ namespace sfx2 { namespace sidebar { TitleBar::TitleBar(const OUString& rsTitle, vcl::Window* pParentWindow, const sidebar::Paint& rInitialBackgroundPaint) - : Window(pParentWindow), - maToolBox(VclPtr<SidebarToolBox>::Create(this)), - msTitle(rsTitle), - maIcon() + : Window(pParentWindow) + , maToolBox(VclPtr<SidebarToolBox>::Create(this)) + , msTitle(rsTitle) + , maIcon() + , maBackgroundPaint(rInitialBackgroundPaint) { - SetBackground(rInitialBackgroundPaint.GetWallpaper()); - maToolBox->SetSelectHdl(LINK(this, TitleBar, SelectionHandler)); } @@ -72,6 +71,11 @@ void TitleBar::SetIcon(const Image& rIcon) Invalidate(); } +void TitleBar::ApplySettings(vcl::RenderContext& rRenderContext) +{ + rRenderContext.SetBackground(maBackgroundPaint.GetWallpaper()); +} + void TitleBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpdateArea*/) { // Paint title bar background. @@ -84,11 +88,10 @@ void TitleBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpd PaintFocus(rRenderContext, aTitleBox); } -void TitleBar::DataChanged (const DataChangedEvent& rEvent) +void TitleBar::DataChanged (const DataChangedEvent& /*rEvent*/) { - (void)rEvent; - - SetBackground(GetBackgroundPaint().GetWallpaper()); + maBackgroundPaint = GetBackgroundPaint(); + Invalidate(); } void TitleBar::setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags) diff --git a/sfx2/source/sidebar/TitleBar.hxx b/sfx2/source/sidebar/TitleBar.hxx index 7c9f03f5c0aa..3372385d2588 100644 --- a/sfx2/source/sidebar/TitleBar.hxx +++ b/sfx2/source/sidebar/TitleBar.hxx @@ -38,6 +38,7 @@ public: void SetTitle (const ::rtl::OUString& rsTitle); void SetIcon (const Image& rIcon); + virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) SAL_OVERRIDE; virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE; virtual void setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL) SAL_OVERRIDE; @@ -65,6 +66,7 @@ protected: private: Image maIcon; + sidebar::Paint maBackgroundPaint; void PaintTitle(vcl::RenderContext& rRenderContext, const Rectangle& rTitleBox); DECL_LINK_TYPED(SelectionHandler, ToolBox*, void); |