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,
, 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),
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
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