Kaydet (Commit) 883991e8 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

Header/Footer: use a plus symbol instead of the add icon

This will help drawing the high contrast mode and makes the plus more
visible even given the background color.
üst 99e1ea3c
......@@ -168,6 +168,7 @@ typedef sal_uInt16 SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
#define SYMBOL_PLUS ((SymbolType)35)
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
......
......@@ -214,36 +214,25 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
Size aPicSize( BUTTON_WIDTH, aRect.getHeight() );
Rectangle aSymbolRect( aPicPos, aPicSize );
// 25% distance to the left and right button border
const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth()*250)+500)/1000;
aSymbolRect.Left()+=nBorderDistanceLeftAndRight;
aSymbolRect.Right()-=nBorderDistanceLeftAndRight;
// 30% distance to the top button border
const long nBorderDistanceTop = ((aSymbolRect.GetHeight()*300)+500)/1000;
aSymbolRect.Top()+=nBorderDistanceTop;
// 25% distance to the bottom button border
const long nBorderDistanceBottom = ((aSymbolRect.GetHeight()*250)+500)/1000;
aSymbolRect.Bottom()-=nBorderDistanceBottom;
SymbolType nSymbol = SYMBOL_SPIN_DOWN;
if ( IsEmptyHeaderFooter( ) )
{
SvtResId id( BMP_LIST_ADD );
Image aPlusImg( id );
Size aSize = aPlusImg.GetSizePixel();
Point aPt = aSymbolRect.TopLeft();
long nXOffset = ( aSymbolRect.GetWidth() - aSize.Width() ) / 2;
long nYOffset = ( aSymbolRect.GetHeight() - aSize.Height() ) / 2;
aPt += Point( nXOffset, nYOffset );
DrawImage(aPt, aPlusImg);
}
else
{
// 25% distance to the left and right button border
const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth()*250)+500)/1000;
aSymbolRect.Left()+=nBorderDistanceLeftAndRight;
aSymbolRect.Right()-=nBorderDistanceLeftAndRight;
// 30% distance to the top button border
const long nBorderDistanceTop = ((aSymbolRect.GetHeight()*300)+500)/1000;
aSymbolRect.Top()+=nBorderDistanceTop;
// 25% distance to the bottom button border
const long nBorderDistanceBottom = ((aSymbolRect.GetHeight()*250)+500)/1000;
aSymbolRect.Bottom()-=nBorderDistanceBottom;
DecorationView aDecoView( this );
aDecoView.DrawSymbol( aSymbolRect, SYMBOL_SPIN_DOWN,
( Application::GetSettings().GetStyleSettings().GetHighContrastMode()
? Color( COL_WHITE )
: Color( COL_BLACK ) ) );
}
nSymbol = SYMBOL_PLUS;
DecorationView aDecoView( this );
aDecoView.DrawSymbol( aSymbolRect, nSymbol,
( Application::GetSettings().GetStyleSettings().GetHighContrastMode()
? Color( COL_WHITE )
: Color( COL_BLACK ) ) );
}
}
......
......@@ -72,6 +72,7 @@ typedef sal_uInt16 SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
#define SYMBOL_PLUS ((SymbolType)35)
#define SYMBOL_MENU SYMBOL_SPIN_DOWN
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
......
......@@ -566,6 +566,17 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
pDev->DrawRect( aRect );
}
break;
case SYMBOL_PLUS:
{
nLeft = nCenterX-n2;
nRight = nCenterX+n2;
nTop = nCenterY-n2;
nBottom = nCenterY+n2;
pDev->DrawRect( Rectangle( nLeft, nCenterY - 1, nRight, nCenterY + 1 ) );
pDev->DrawRect( Rectangle( nCenterX - 1, nTop, nCenterX + 1, nBottom ) );
}
break;
}
}
......
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