Kaydet (Commit) fbd52034 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

ruler: Kill STYLE_OPTION_MONO usage.

According to the discussion on the design@ list, we want much more flat look
overall anyway, so no need to distinguish between '3D' and 'flat' look.

Change-Id: Ibf88d722c9ebfa9872ffd9a1a156b77478ded655
üst e8897be1
......@@ -228,8 +228,6 @@ ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData )
void Ruler::ImplInit( WinBits nWinBits )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
// Default WinBits setzen
if ( !(nWinBits & WB_VERT) )
{
......@@ -281,12 +279,7 @@ void Ruler::ImplInit( WinBits nWinBits )
// Border-Breiten berechnen
if ( nWinBits & WB_BORDER )
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
mnBorderWidth = 2;
else
mnBorderWidth = 1;
}
else
mnBorderWidth = 0;
......@@ -677,13 +670,9 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
if ( (n2-n1) > 3 )
{
maVirDev.SetLineColor();
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
else
maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
ImplVDrawRect( n1, nVirTop, n2, nVirBottom );
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
ImplVDrawLine( n1+1, nVirTop, n1+1, nVirBottom );
ImplVDrawLine( n1, nVirTop, n2, nVirTop );
......@@ -693,13 +682,6 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
ImplVDrawLine( n2-1, nVirTop, n2-1, nVirBottom );
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
ImplVDrawLine( n2, nVirTop, n2, nVirBottom );
}
else
{
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
ImplVDrawLine( n1, nVirTop, n1, nVirBottom );
ImplVDrawLine( n2, nVirTop, n2, nVirBottom );
}
if ( mpData->pBorders[i].nStyle & RULER_BORDER_VARIABLE )
{
......@@ -710,17 +692,14 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
long nTemp3 = nTemp1+RULER_VAR_SIZE-1;
long nTemp4 = nTemp2+RULER_VAR_SIZE-1;
long nTempY = nTemp2;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
else
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
while ( nTempY <= nTemp4 )
{
ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY );
nTempY += 2;
}
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
nTempY = nTemp2+1;
maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
while ( nTempY <= nTemp4 )
......@@ -730,13 +709,10 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
}
}
}
}
if ( mpData->pBorders[i].nStyle & RULER_BORDER_SIZEABLE )
{
if ( n2-n1 > RULER_VAR_SIZE+10 )
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
ImplVDrawLine( n1+4, nVirTop+3, n1+4, nVirBottom-3 );
......@@ -745,22 +721,13 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
ImplVDrawLine( n1+5, nVirTop+3, n1+5, nVirBottom-3 );
ImplVDrawLine( n2-4, nVirTop+3, n2-4, nVirBottom-3 );
}
else
{
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
ImplVDrawLine( n1+4, nVirTop+3, n1+4, nVirBottom-3 );
ImplVDrawLine( n2-4, nVirTop+3, n2-4, nVirBottom-3 );
}
}
}
}
else
{
n = n1+((n2-n1)/2);
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
else
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
if ( mpData->pBorders[i].nStyle & RULER_BORDER_SNAP )
ImplVDrawLine( n, nVirTop, n, nVirBottom );
else if ( mpData->pBorders[i].nStyle & RULER_BORDER_MARGIN )
......@@ -803,7 +770,7 @@ void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle )
maVirDev.DrawPolygon( rPoly );
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && !(nStyle & RULER_STYLE_DONTKNOW) )
if ( !(nStyle & RULER_STYLE_DONTKNOW) )
{
if ( nIndentStyle == RULER_INDENT_BOTTOM )
{
......@@ -1204,7 +1171,6 @@ void Ruler::ImplFormat()
return;
Size aVirDevSize;
sal_Bool b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
// initialize VirtualDevice
if ( mnWinStyle & WB_HORZ )
......@@ -1261,10 +1227,7 @@ void Ruler::ImplFormat()
}
// Obere/untere Kante ausgeben
if ( b3DLook )
maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
else
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
ImplVDrawLine( nVirLeft, nVirTop, nM1 - 1, nVirTop ); //top left line
ImplVDrawLine( nM2 +1, nVirTop, nP2 -1, nVirTop ); //top right line
......@@ -1274,10 +1237,7 @@ void Ruler::ImplFormat()
// Margin1, Margin2 und Zwischenraum ausgeben
maVirDev.SetLineColor();
if ( b3DLook )
maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
else
maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
if ( nM1 > nVirLeft )
ImplVDrawRect( nP1, nVirTop, nM1-1, nVirBottom ); //left gray rectangle
if ( nM2 < nP2 )
......@@ -1287,8 +1247,6 @@ void Ruler::ImplFormat()
maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
ImplVDrawRect( nM1, nVirTop, nM2-1, nVirBottom ); //center rectangle
}
if ( b3DLook )
{
maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
if ( nM1 > nVirLeft )
{
......@@ -1307,19 +1265,6 @@ void Ruler::ImplFormat()
if ( nP2 <= nVirRight+1 )
ImplVDrawLine( nP2-1, nVirTop, nP2-1, nVirBottom );//right line of the right rectangle
}
}
else
{
maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
if ( nP1 >= nVirLeft )
ImplVDrawLine( nP1, nVirTop, nP1, nVirBottom+1 );
if ( nM1 > nP1 )
ImplVDrawLine( nM1, nVirTop, nM1, nVirBottom );
if ( nM2 < nP2 )
ImplVDrawLine( nM2, nVirTop, nM2, nVirBottom );
if ( nP2 <= nVirRight+1 )
ImplVDrawLine( nP2, nVirTop, nP2, nVirBottom+1 );
}
// Lineal-Beschriftung (nur wenn keine Bemassungspfeile)
long nMin = nVirLeft;
......@@ -1437,32 +1382,19 @@ void Ruler::ImplDrawExtra( sal_Bool bPaint )
Rectangle aRect = maExtraRect;
sal_Bool bEraseRect = sal_False;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
aRect.Left() += 2;
aRect.Top() += 2;
aRect.Right() -= 2;
aRect.Bottom() -= 2;
}
else
{
aRect.Left() += 1;
aRect.Top() += 1;
aRect.Right() -= 1;
aRect.Bottom() -= 1;
}
if ( !bPaint && !(mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
SetFillColor( rStyleSettings.GetFaceColor() );
else
SetFillColor( rStyleSettings.GetWindowColor() );
bEraseRect = sal_True;
}
else
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
if ( mnExtraStyle & RULER_STYLE_HIGHLIGHT )
{
SetFillColor( rStyleSettings.GetCheckedColor() );
bEraseRect = sal_True;
......@@ -1478,10 +1410,7 @@ void Ruler::ImplDrawExtra( sal_Bool bPaint )
// Inhalt ausgeben
if ( meExtraType == RULER_EXTRA_NULLOFFSET )
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
SetLineColor( rStyleSettings.GetButtonTextColor() );
else
SetLineColor( rStyleSettings.GetWindowTextColor() );
DrawLine( Point( aRect.Left()+1, aRect.Top()+4 ),
Point( aRect.Right()-1, aRect.Top()+4 ) );
DrawLine( Point( aRect.Left()+4, aRect.Top()+1 ),
......@@ -1509,9 +1438,6 @@ void Ruler::ImplDrawExtra( sal_Bool bPaint )
}
ImplDrawTab( this, aDraw, nTabStyle );
}
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
Invert( aRect );
}
// -----------------------------------------------------------------------
......@@ -2234,8 +2160,6 @@ void Ruler::Paint( const Rectangle& )
// Extra-Field beruecksichtigen
if ( mnWinStyle & WB_EXTRAFIELD )
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
SetLineColor( rStyleSettings.GetShadowColor() );
DrawLine( Point( maExtraRect.Left(), maExtraRect.Top() ),
......@@ -2255,13 +2179,6 @@ void Ruler::Paint( const Rectangle& )
Point( maExtraRect.Right(), maExtraRect.Bottom() ) );
DrawLine( Point( maExtraRect.Right(), maExtraRect.Top() ),
Point( maExtraRect.Right(), maExtraRect.Bottom() ) );
}
else
{
SetLineColor( rStyleSettings.GetWindowTextColor() );
SetFillColor( rStyleSettings.GetWindowColor() );
DrawRect( maExtraRect );
}
// Imhalt vom Extrafeld ausgeben
ImplDrawExtra( sal_True );
......@@ -2270,8 +2187,6 @@ void Ruler::Paint( const Rectangle& )
if ( mnWinStyle & WB_BORDER )
{
if ( mnWinStyle & WB_HORZ )
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
SetLineColor( rStyleSettings.GetShadowColor() );
DrawLine( Point( mnBorderOff, mnHeight-2 ),
......@@ -2281,14 +2196,12 @@ void Ruler::Paint( const Rectangle& )
DrawLine( Point( mnBorderOff-1, mnHeight-2 ),
Point( mnBorderOff-1, mnHeight-1 ) );
}
}
SetLineColor( rStyleSettings.GetWindowTextColor() );
DrawLine( Point( mnBorderOff, mnHeight-1 ),
Point( mnWidth, mnHeight-1 ) );
}
else
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
SetLineColor( rStyleSettings.GetShadowColor() );
DrawLine( Point( mnWidth-2, mnBorderOff ),
......@@ -2298,7 +2211,7 @@ void Ruler::Paint( const Rectangle& )
DrawLine( Point( mnWidth-2, mnBorderOff-1 ),
Point( mnWidth-1, mnBorderOff-1 ) );
}
}
SetLineColor( rStyleSettings.GetWindowTextColor() );
DrawLine( Point( mnWidth-1, mnBorderOff ),
Point( mnWidth-1, mnHeight ) );
......
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