From e661a775151ed12358f71bc2bb6608bb21638023 Mon Sep 17 00:00:00 2001
From: Joel Madero <jmadero.dev@gmail.com>
Date: Thu, 12 Jul 2012 17:25:20 -0700
Subject: [PATCH] fdo: #47164: Shifts recent doc symbol, shifts and expands
 hotspot area

In order to expand the recent documents hotspot area on the backing window I had to separate the rectangle which is used by the
arrow symbol from the hotspot rectangle. There is some repetition of code in order to preserve the if statements in the original code.
Without separating the symbol from the hotspot frame, the arrow symbol grows along with the hotspot frame.

 Please enter the commit message for your changes. Lines starting
 with '#' will be ignored, and an empty message aborts the commit.
 On branch master
 Your branch is ahead of 'origin/master' by 1 commit.

 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

	modified:   vcl/source/control/button.cxx

Change-Id: I067db813bbe78297ab3ed810e32a50b29d044f2d
---
 vcl/source/control/button.cxx |   44 ++++++++++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 11 deletions(-)

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 9ba7e8f..df577da 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -801,7 +801,7 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
         pDev->SetFillColor( Color( COL_BLACK ) );
     else
         pDev->SetFillColor( rColor );
-    pDev->DrawRect( Rectangle( nX+0, nY+0, nX+6, nY+0 ) );
+    pDev->DrawRect( Rectangle( nX-0, nY+0, nX+6, nY+0 ) );
     pDev->DrawRect( Rectangle( nX+1, nY+1, nX+5, nY+1 ) );
     pDev->DrawRect( Rectangle( nX+2, nY+2, nX+4, nY+2 ) );
     pDev->DrawRect( Rectangle( nX+3, nY+3, nX+3, nY+3 ) );
@@ -862,17 +862,37 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
     {
         if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
         {
-            // calc Symbol- and Textrect
+            // calc Symbol
             long nSymbolSize    = pDev->GetTextHeight() / 2 + 1;
-            aInRect.Right()    -= 5;
+
+            aInRect.Right()    -= 2; //rectangle width
             aInRect.Left()      = aInRect.Right() - nSymbolSize;
-            aSize.Width()      -= ( 5 + nSymbolSize );
+        }
+        else
+            ImplCalcSymbolRect( aInRect );
+
+        if( ! bLayout )
+        {
+            long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
+            DecorationView aDecoView( pDev );
+            if( bMenuBtnSep )
+            {
+                long nX = aInRect.Left() - 3*nDistance;
+            }
 
+            aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
+        }
+
+       //repetition of code above in order to separate symbol from frame. New dimension for rectangle
+       if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
+        {
+            long nSymbolSize    = pDev->GetTextHeight() / 2 + 1;
+            aInRect.Right()    += 10; //rectangle width
+            aInRect.Left()      = aInRect.Right() - 3*nSymbolSize;
+            aSize.Width()      -= ( 5 + nSymbolSize );
             ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
                                   nDrawFlags, nTextStyle, NULL, true );
         }
-        else
-            ImplCalcSymbolRect( aInRect );
 
         if( ! bLayout )
         {
@@ -880,13 +900,12 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
             DecorationView aDecoView( pDev );
             if( bMenuBtnSep )
             {
-                long nX = aInRect.Left() - 2*nDistance;
-                Point aStartPt( nX, aInRect.Top()+nDistance );
+                long nX = aInRect.Left() - 3*nDistance;
+                Point aStartPt( nX+10, aInRect.Top()+nDistance );
                 Point aEndPt( nX, aInRect.Bottom()-nDistance );
                 aDecoView.DrawSeparator( aStartPt, aEndPt );
             }
-            aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
-            aInRect.Left() -= 2*nDistance;
+            aInRect.Left() -= -3*nDistance;
             ImplSetSymbolRect( aInRect );
         }
     }
@@ -921,7 +940,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
                 }
             }
 
-            ImplDrawBtnDropDownArrow( pDev, aInRect.Right()-6, aInRect.Top()+1,
+            ImplDrawBtnDropDownArrow( pDev, aInRect.Right()+6, aInRect.Top()+1,
                                       aArrowColor, bBlack );
         }
     }
@@ -953,6 +972,9 @@ void PushButton::ImplDrawPushButton( bool bLayout )
     Rectangle               aTextRect;
     sal_Bool                    bNativeOK = sal_False;
 
+
+
+
     // adjust style if button should be rendered 'pressed'
     if ( mbPressed )
         nButtonStyle |= BUTTON_DRAW_PRESSED;
-- 
1.7.9.5

