Kaydet (Commit) d0f20c37 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Deck, TitleBar - setup background in ApplySettings

Change-Id: I3468176b8605094887f1d81ce37ef2c47719e3e7
üst 56366b91
...@@ -50,8 +50,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, ...@@ -50,8 +50,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow,
, mpFiller(VclPtr<vcl::Window>::Create(this)) , mpFiller(VclPtr<vcl::Window>::Create(this))
, mpVerticalScrollBar(VclPtr<ScrollBar>::Create(this)) , mpVerticalScrollBar(VclPtr<ScrollBar>::Create(this))
{ {
SetBackground(Wallpaper());
mpScrollClipWindow->SetBackground(Wallpaper()); mpScrollClipWindow->SetBackground(Wallpaper());
mpScrollClipWindow->Show(); mpScrollClipWindow->Show();
...@@ -111,10 +109,13 @@ Rectangle Deck::GetContentArea() const ...@@ -111,10 +109,13 @@ Rectangle Deck::GetContentArea() const
aWindowSize.Height() - 1 - Theme::GetInteger(Theme::Int_DeckBottomPadding) - nBorderSize); 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 Size aWindowSize (GetSizePixel());
const SvBorder aPadding(Theme::GetInteger(Theme::Int_DeckLeftPadding), const SvBorder aPadding(Theme::GetInteger(Theme::Int_DeckLeftPadding),
Theme::GetInteger(Theme::Int_DeckTopPadding), Theme::GetInteger(Theme::Int_DeckTopPadding),
......
...@@ -64,9 +64,10 @@ public: ...@@ -64,9 +64,10 @@ public:
*/ */
void ShowPanel (const Panel& rPanel); 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 Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) SAL_OVERRIDE;
virtual void DataChanged (const DataChangedEvent& rEvent) 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); static void PrintWindowSubTree (vcl::Window* pRoot, int nIndentation);
......
...@@ -39,13 +39,12 @@ namespace sfx2 { namespace sidebar { ...@@ -39,13 +39,12 @@ namespace sfx2 { namespace sidebar {
TitleBar::TitleBar(const OUString& rsTitle, TitleBar::TitleBar(const OUString& rsTitle,
vcl::Window* pParentWindow, vcl::Window* pParentWindow,
const sidebar::Paint& rInitialBackgroundPaint) const sidebar::Paint& rInitialBackgroundPaint)
: Window(pParentWindow), : Window(pParentWindow)
maToolBox(VclPtr<SidebarToolBox>::Create(this)), , maToolBox(VclPtr<SidebarToolBox>::Create(this))
msTitle(rsTitle), , msTitle(rsTitle)
maIcon() , maIcon()
, maBackgroundPaint(rInitialBackgroundPaint)
{ {
SetBackground(rInitialBackgroundPaint.GetWallpaper());
maToolBox->SetSelectHdl(LINK(this, TitleBar, SelectionHandler)); maToolBox->SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
} }
...@@ -72,6 +71,11 @@ void TitleBar::SetIcon(const Image& rIcon) ...@@ -72,6 +71,11 @@ void TitleBar::SetIcon(const Image& rIcon)
Invalidate(); Invalidate();
} }
void TitleBar::ApplySettings(vcl::RenderContext& rRenderContext)
{
rRenderContext.SetBackground(maBackgroundPaint.GetWallpaper());
}
void TitleBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpdateArea*/) void TitleBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpdateArea*/)
{ {
// Paint title bar background. // Paint title bar background.
...@@ -84,11 +88,10 @@ void TitleBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpd ...@@ -84,11 +88,10 @@ void TitleBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rUpd
PaintFocus(rRenderContext, aTitleBox); PaintFocus(rRenderContext, aTitleBox);
} }
void TitleBar::DataChanged (const DataChangedEvent& rEvent) void TitleBar::DataChanged (const DataChangedEvent& /*rEvent*/)
{ {
(void)rEvent; maBackgroundPaint = GetBackgroundPaint();
Invalidate();
SetBackground(GetBackgroundPaint().GetWallpaper());
} }
void TitleBar::setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags) void TitleBar::setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
......
...@@ -38,6 +38,7 @@ public: ...@@ -38,6 +38,7 @@ public:
void SetTitle (const ::rtl::OUString& rsTitle); void SetTitle (const ::rtl::OUString& rsTitle);
void SetIcon (const Image& rIcon); 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 Paint(vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) SAL_OVERRIDE;
virtual void DataChanged (const DataChangedEvent& rEvent) 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; virtual void setPosSizePixel (long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL) SAL_OVERRIDE;
...@@ -65,6 +66,7 @@ protected: ...@@ -65,6 +66,7 @@ protected:
private: private:
Image maIcon; Image maIcon;
sidebar::Paint maBackgroundPaint;
void PaintTitle(vcl::RenderContext& rRenderContext, const Rectangle& rTitleBox); void PaintTitle(vcl::RenderContext& rRenderContext, const Rectangle& rTitleBox);
DECL_LINK_TYPED(SelectionHandler, ToolBox*, void); DECL_LINK_TYPED(SelectionHandler, ToolBox*, void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment