diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-18 11:14:17 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-18 11:22:49 +0900 |
commit | e27ee95cced755e52b62d6cb095bc911ca3fbbe6 (patch) | |
tree | 202ccf724d68ddbf791f483ad6cc8672195c2b75 | |
parent | a97fc29f726b7fcc5ab36496e117e2a1aec9747d (diff) |
pass RenderContext to PreparePaint in TreeListBox
Change-Id: I32961f5cd511b9ecc756e99ca95e4e9ddbc6b795
-rw-r--r-- | dbaccess/source/ui/app/AppDetailView.cxx | 23 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailView.hxx | 4 | ||||
-rw-r--r-- | include/svtools/treelistbox.hxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 25 |
4 files changed, 27 insertions, 27 deletions
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index bd4ba2f048c0..0ae17bf52169 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -98,31 +98,32 @@ void OCreationList::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _ rRenderContext.SetFont(m_aOriginalFont); } -void OCreationList::PreparePaint( SvTreeListEntry* _pEntry ) +void OCreationList::PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* _pEntry) { - Wallpaper aEntryBackground( m_aOriginalBackgroundColor ); - if ( _pEntry ) + Wallpaper aEntryBackground(m_aOriginalBackgroundColor); + if (_pEntry) { - if ( _pEntry == GetCurEntry() ) + if (_pEntry == GetCurEntry()) { // draw a selection background bool bIsMouseDownEntry = ( _pEntry == m_pMouseDownEntry ); - DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, false, true, false ); + vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, GetBoundingRect(_pEntry), + bIsMouseDownEntry ? 1 : 2, false, true, false ); - if ( bIsMouseDownEntry ) + if (bIsMouseDownEntry) { - vcl::Font aFont( GetFont() ); - aFont.SetColor( GetSettings().GetStyleSettings().GetHighlightTextColor() ); - Control::SetFont( aFont ); + vcl::Font aFont(rRenderContext.GetFont()); + aFont.SetColor(rRenderContext.GetSettings().GetStyleSettings().GetHighlightTextColor()); + rRenderContext.SetFont(aFont); } // and temporary set a transparent background, for all the other // paint operations the SvTreeListBox is going to do - aEntryBackground = Wallpaper( Color( COL_TRANSPARENT ) ); + aEntryBackground = Wallpaper(Color(COL_TRANSPARENT)); } } - SetBackground( aEntryBackground ); + rRenderContext.SetBackground(aEntryBackground); } void OCreationList::SelectSearchEntry( const void* _pEntry ) diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index e4f7974799e4..3b4286abe7ac 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -61,7 +61,7 @@ namespace dbaui virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; - virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE; + virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE; @@ -71,7 +71,7 @@ namespace dbaui void updateHelpText(); protected: - virtual void PreparePaint( SvTreeListEntry* _pEntry ) SAL_OVERRIDE; + virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* _pEntry) SAL_OVERRIDE; virtual Rectangle GetFocusRect( SvTreeListEntry* _pEntry, long _nLine ) SAL_OVERRIDE; virtual void ModelHasCleared() SAL_OVERRIDE; diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index 90d8eae36b60..24446dcca726 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -617,7 +617,7 @@ protected: virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; - virtual void PreparePaint( SvTreeListEntry* ); + virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* pEntry); virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; void InitSettings(bool bFont, bool bForeground, bool bBackground); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index b6d18de66122..3b27f3d4ce2a 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -2565,7 +2565,7 @@ void SvTreeListBox::AdjustEntryHeightAndRecalc( const vcl::Font& rFont ) void SvTreeListBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { Control::Paint(rRenderContext, rRect); - if(nTreeFlags & SvTreeFlags::RECALCTABS) + if (nTreeFlags & SvTreeFlags::RECALCTABS) SetTabs(); pImp->Paint(rRenderContext, rRect); @@ -2837,21 +2837,20 @@ SvTreeListEntry* SvTreeListBox::GetCurEntry() const void SvTreeListBox::ImplInitStyle() { - const WinBits nWindowStyle = GetStyle(); nTreeFlags |= SvTreeFlags::RECALCTABS; - if( nWindowStyle & WB_SORT ) + if (nWindowStyle & WB_SORT) { - GetModel()->SetSortMode( SortAscending ); - GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare)); + GetModel()->SetSortMode(SortAscending); + GetModel()->SetCompareHdl(LINK(this, SvTreeListBox, DefaultCompare)); } else { - GetModel()->SetSortMode( SortNone ); - GetModel()->SetCompareHdl( Link<>() ); + GetModel()->SetSortMode(SortNone); + GetModel()->SetCompareHdl(Link<>()); } - pImp->SetStyle( nWindowStyle ); + pImp->SetStyle(nWindowStyle); pImp->Resize(); Invalidate(); } @@ -2884,7 +2883,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render Rectangle aRect; // multi purpose bool bHorSBar = pImp->HasHorScrollBar(); - PreparePaint(pEntry); + PreparePaint(rRenderContext, pEntry); pImp->UpdateContextBmpWidthMax(pEntry); @@ -2986,7 +2985,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render { // if the face color is bright then the deactive color is also bright // -> so you can't see any deactive selection - if ( bHideSelection && !rSettings.GetFaceColor().IsBright() + if (bHideSelection && !rSettings.GetFaceColor().IsBright() && aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright()) { aNewWallColor = rSettings.GetDeactiveColor(); @@ -3054,7 +3053,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render // A custom selection that starts at a tab position > 0, do not fill // the background of the 0th item, else e.g. we might not be able to // realize tab listboxes with lines. - if (!(nCurTab==0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab)) + if (!(nCurTab == 0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab)) { rRenderContext.SetFillColor(aWallpaper.GetColor()); // this case may occur for smaller horizontal resizes @@ -3087,7 +3086,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render // cursor emphasis rRenderContext.SetFillColor(); Color aOldLineColor = rRenderContext.GetLineColor(); - SetLineColor(Color(COL_BLACK)); + rRenderContext.SetLineColor(Color(COL_BLACK)); aRect = GetFocusRect(pEntry, nLine); aRect.Top()++; aRect.Bottom()--; @@ -3197,7 +3196,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render return 0; // nRowLen; } -void SvTreeListBox::PreparePaint( SvTreeListEntry* ) +void SvTreeListBox::PreparePaint(vcl::RenderContext& /*rRenderContext*/, SvTreeListEntry* /*pEntry*/) { } |