summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-20 18:14:08 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-20 19:44:25 +0900
commit00920bf83688f185bf05070599e7083af01ac665 (patch)
treea8a8b1a22d815b94780f47c4d98d55b8566b825b /vcl
parent7e34c092d3d0f085eee3097b1d4ad038da39f9de (diff)
scrollbar - setup painting settings in ApplySettings
Change-Id: I5eeaa1ee9c63f1a1d624022857a80cbebc079627
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/scrbar.cxx33
1 files changed, 14 insertions, 19 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 696cae77366f..8e9f4b7d80ba 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -106,7 +106,6 @@ void ScrollBar::ImplInit( vcl::Window* pParent, WinBits nStyle )
long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize();
SetSizePixel( Size( nScrollSize, nScrollSize ) );
- SetBackground();
}
void ScrollBar::ImplInitStyle( WinBits nStyle )
@@ -1121,6 +1120,11 @@ void ScrollBar::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
}
+void ScrollBar::ApplySettings(vcl::RenderContext& rRenderContext)
+{
+ rRenderContext.SetBackground();
+}
+
void ScrollBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{
ImplDraw(rRenderContext, SCRBAR_DRAW_ALL);
@@ -1448,14 +1452,13 @@ Size ScrollBar::getCurrentCalcSize() const
return aCtrlRegion.GetSize();
}
-void ScrollBarBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
+void ScrollBarBox::ImplInit(vcl::Window* pParent, WinBits nStyle)
{
Window::ImplInit( pParent, nStyle, NULL );
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
long nScrollSize = rStyleSettings.GetScrollBarSize();
- SetSizePixel( Size( nScrollSize, nScrollSize ) );
- ImplInitSettings();
+ SetSizePixel(Size(nScrollSize, nScrollSize));
}
ScrollBarBox::ScrollBarBox( vcl::Window* pParent, WinBits nStyle ) :
@@ -1464,18 +1467,12 @@ ScrollBarBox::ScrollBarBox( vcl::Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
-void ScrollBarBox::ImplInitSettings()
+void ScrollBarBox::ApplySettings(vcl::RenderContext& rRenderContext)
{
- // FIXME: Hack so that we can build DockingWindows even without background
- // and not everything has been switched over yet
- if ( IsBackground() )
+ if (rRenderContext.IsBackground())
{
- Color aColor;
- if ( IsControlBackground() )
- aColor = GetControlBackground();
- else
- aColor = GetSettings().GetStyleSettings().GetFaceColor();
- SetBackground( aColor );
+ Color aColor = rRenderContext.GetSettings().GetStyleSettings().GetFaceColor();
+ ApplyControlBackground(rRenderContext, aColor);
}
}
@@ -1483,9 +1480,8 @@ void ScrollBarBox::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
- if ( nType == StateChangedType::ControlBackground )
+ if (nType == StateChangedType::ControlBackground)
{
- ImplInitSettings();
Invalidate();
}
}
@@ -1494,10 +1490,9 @@ void ScrollBarBox::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
- if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
- (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
+ if ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
+ (rDCEvt.GetFlags() & AllSettingsFlags::STYLE))
{
- ImplInitSettings();
Invalidate();
}
}