vcl/source/window/brdwin.cxx |   39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

New commits:
commit bd62fc70815186639622b7d71607c224f02e71a6
Author:     Dan Williams <[email protected]>
AuthorDate: Mon Jan 5 10:50:31 2026 -0600
Commit:     Dan Williams <[email protected]>
CommitDate: Thu Feb 12 16:53:18 2026 +0100

    vcl: convert ImplStdBorderWindowView to 
vcl::Window::DrawSelectionBackground()
    
    Continue the work that this commit started:
    
    dfb70a8f6367 "Add DrawSelectionBackground that is outside of vcl::Window"
    
    Change-Id: I36555a292b25076dbcc5107a364d6db7d1bd5d6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196585
    Tested-by: Jenkins
    Reviewed-by: Dan Williams <[email protected]>

diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 5a3951fb210e..e13ba5feb04c 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -64,18 +64,18 @@ void Window::ImplCalcSymbolRect( tools::Rectangle& rRect )
 
 } /* namespace vcl */
 
-static void ImplDrawBrdWinSymbol( vcl::RenderContext* pDev,
+static void ImplDrawBrdWinSymbol( vcl::RenderContext& rRenderContext,
                                   const tools::Rectangle& rRect, SymbolType 
eSymbol )
 {
     // we leave 5% room between the symbol and the button border
-    DecorationView  aDecoView( pDev );
+    DecorationView  aDecoView( &rRenderContext );
     tools::Rectangle       aTempRect = rRect;
     vcl::Window::ImplCalcSymbolRect( aTempRect );
     aDecoView.DrawSymbol( aTempRect, eSymbol,
-                          
pDev->GetSettings().GetStyleSettings().GetButtonTextColor() );
+                          
rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor() );
 }
 
-static void ImplDrawBrdWinSymbolButton( vcl::RenderContext* pDev,
+static void ImplDrawBrdWinSymbolButton( vcl::RenderContext& rRenderContext,
                                         const tools::Rectangle& rRect,
                                         SymbolType eSymbol, DrawButtonFlags 
nState )
 {
@@ -83,30 +83,31 @@ static void ImplDrawBrdWinSymbolButton( vcl::RenderContext* 
pDev,
     nState &= ~DrawButtonFlags::Highlight;
 
     tools::Rectangle aTempRect;
-    vcl::Window *pWin = pDev->GetOwnerWindow();
+    vcl::Window *pWin = rRenderContext.GetOwnerWindow();
     if( pWin )
     {
         if( bMouseOver )
         {
             // provide a bright background for selection effect
-            pDev->SetFillColor( 
pDev->GetSettings().GetStyleSettings().GetWindowColor() );
-            pDev->SetLineColor();
-            pDev->DrawRect( rRect );
-            pWin->DrawSelectionBackground( rRect, 2, bool(nState & 
DrawButtonFlags::Pressed),
-                                            true );
+            rRenderContext.SetFillColor( 
rRenderContext.GetSettings().GetStyleSettings().GetWindowColor() );
+            rRenderContext.SetLineColor();
+            rRenderContext.DrawRect( rRect );
+            vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pWin, 
rRect, 2,
+                                                      bool(nState & 
DrawButtonFlags::Pressed),
+                                                      true, false );
         }
         aTempRect = rRect;
-        aTempRect.AdjustLeft(3 );
+        aTempRect.AdjustLeft( 3 );
         aTempRect.AdjustRight( -4 );
-        aTempRect.AdjustTop(3 );
+        aTempRect.AdjustTop( 3 );
         aTempRect.AdjustBottom( -4 );
     }
     else
     {
-        DecorationView aDecoView( pDev );
+        DecorationView aDecoView( &rRenderContext );
         aTempRect = aDecoView.DrawButton( rRect, nState|DrawButtonFlags::Flat 
);
     }
-    ImplDrawBrdWinSymbol( pDev, aTempRect, eSymbol );
+    ImplDrawBrdWinSymbol( rRenderContext, aTempRect, eSymbol );
 }
 
 
@@ -1483,28 +1484,28 @@ void 
ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con
         tools::Rectangle aSymbolRect(pData->maCloseRect);
         if (pOffset)
             aSymbolRect.Move(pOffset->X(), pOffset->Y());
-        ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, 
SymbolType::CLOSE, pData->mnCloseState);
+        ImplDrawBrdWinSymbolButton(rRenderContext, aSymbolRect, 
SymbolType::CLOSE, pData->mnCloseState);
     }
     if (!pData->maDockRect.IsEmpty())
     {
         tools::Rectangle aSymbolRect(pData->maDockRect);
         if (pOffset)
             aSymbolRect.Move(pOffset->X(), pOffset->Y());
-        ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, 
SymbolType::DOCK, pData->mnDockState);
+        ImplDrawBrdWinSymbolButton(rRenderContext, aSymbolRect, 
SymbolType::DOCK, pData->mnDockState);
     }
     if (!pData->maMenuRect.IsEmpty())
     {
         tools::Rectangle aSymbolRect(pData->maMenuRect);
         if (pOffset)
             aSymbolRect.Move(pOffset->X(), pOffset->Y());
-        ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, 
SymbolType::MENU, pData->mnMenuState);
+        ImplDrawBrdWinSymbolButton(rRenderContext, aSymbolRect, 
SymbolType::MENU, pData->mnMenuState);
     }
     if (!pData->maHideRect.IsEmpty())
     {
         tools::Rectangle aSymbolRect(pData->maHideRect);
         if (pOffset)
             aSymbolRect.Move(pOffset->X(), pOffset->Y());
-        ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, 
SymbolType::HIDE, pData->mnHideState);
+        ImplDrawBrdWinSymbolButton(rRenderContext, aSymbolRect, 
SymbolType::HIDE, pData->mnHideState);
     }
 
     if (!pData->maHelpRect.IsEmpty())
@@ -1512,7 +1513,7 @@ void 
ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con
         tools::Rectangle aSymbolRect(pData->maHelpRect);
         if (pOffset)
             aSymbolRect.Move(pOffset->X(), pOffset->Y());
-        ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, 
SymbolType::HELP, pData->mnHelpState);
+        ImplDrawBrdWinSymbolButton(rRenderContext, aSymbolRect, 
SymbolType::HELP, pData->mnHelpState);
     }
 }
 

Reply via email to