renaissance1: #i107215# Improved high contrast handling.

This commit is contained in:
Andre Fischer
2010-06-14 18:02:38 +02:00
parent 260dd6af0f
commit caef452db3
4 changed files with 20 additions and 6 deletions

View File

@@ -85,6 +85,7 @@ public:
Color_PageNumber,
Color_Selection,
Color_PreviewBorder,
Color_PageCountFontColor,
_ColorType_Size_
};
ColorData GetColor (const ColorType eType);

View File

@@ -319,10 +319,10 @@ void InsertionIndicatorOverlay::PaintPageCount (
rDevice.DrawRect(GrowRectangle(aTextBox, nBorder));
rDevice.SetFillColor();
rDevice.SetLineColor(COL_WHITE);
rDevice.SetLineColor(pTheme->GetColor(Theme::Color_PageCountFontColor));
rDevice.DrawRect(GrowRectangle(aTextBox, nBorder-1));
rDevice.SetTextColor(COL_WHITE);
rDevice.SetTextColor(pTheme->GetColor(Theme::Color_PageCountFontColor));
rDevice.DrawText(aTextBox.TopLeft()-aTextOffset, sNumber);
}
}

View File

@@ -383,7 +383,7 @@ Bitmap& PageObjectPainter::GetBackgroundForState (
maMouseOverBackground,
Theme::Gradient_MouseOverPage,
rReferenceDevice,
(eState & Focused));
(eState & Focused)!=0);
case Selected | Focused:
return GetBackground(
@@ -448,7 +448,12 @@ Bitmap PageObjectPainter::CreateBackgroundBitmap(
VirtualDevice aBitmapDevice (rReferenceDevice);
aBitmapDevice.SetOutputSizePixel(aSize);
// Paint the background with a linear gradient that starts some pixels
// Fill the background with the background color of the slide sorter.
aBitmapDevice.SetFillColor(mpTheme->GetColor(Theme::Color_Background));
aBitmapDevice.SetLineColor(mpTheme->GetColor(Theme::Color_Background));
aBitmapDevice.DrawRect(Rectangle(Point(0,0), aSize));
// Paint the slide area with a linear gradient that starts some pixels
// below the top and ends some pixels above the bottom.
const sal_Int32 nHeight (aPageObjectBox.GetHeight());
const sal_Int32 nDefaultConstantSize(nHeight/4);

View File

@@ -138,6 +138,10 @@ Theme::Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties)
void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpProperties)
{
const bool bSavedHighContrastMode (mbIsHighContrastMode);
mbIsHighContrastMode = rpProperties->IsHighContrastModeActive();
// Set up colors.
maBackgroundColor = rpProperties->GetBackgroundColor().GetColor();
maPageBackgroundColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
@@ -148,7 +152,12 @@ void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpPropert
maColor[Color_Background] = maBackgroundColor;
const ColorData aSelectionColor (rpProperties->GetSelectionColor().GetColor());
maColor[Color_Selection] = aSelectionColor;
if (Color(aSelectionColor).IsBright())
maColor[Color_PageCountFontColor] = Black;
else
maColor[Color_PageCountFontColor] = White;
// Set up gradients.
SetGradient(Gradient_SelectedPage, aSelectionColor, 50, 50, +100,+100, +50,+25);
SetGradient(Gradient_MouseOverPage, aSelectionColor, 75, 75, +100,+100, +50,+25);
SetGradient(Gradient_SelectedAndFocusedPage, aSelectionColor, 50, 50, +100,+100, -50,-75);
@@ -163,8 +172,7 @@ void Theme::Update (const ::boost::shared_ptr<controller::Properties>& rpPropert
GetGradient(Gradient_FocusedPage).maFillColor1 = GetGradient(Gradient_NormalPage).maFillColor1;
GetGradient(Gradient_FocusedPage).maFillColor2 = GetGradient(Gradient_NormalPage).maFillColor2;
const bool bSavedHighContrastMode (mbIsHighContrastMode);
mbIsHighContrastMode = rpProperties->IsHighContrastModeActive();
// Set up icons.
if (bSavedHighContrastMode != mbIsHighContrastMode || maIcons.empty())
{
LocalResource aResource (RID_SLIDESORTER_ICONS);