summaryrefslogtreecommitdiff
path: root/svtools/source/control/valueset.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-04-22 15:38:05 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:18 +0100
commit60285fdc868635f99644ef1d8a195a2be87074c7 (patch)
treedbd69b9d424b527357c2ba33c2256e99edca3d91 /svtools/source/control/valueset.cxx
parent3af7ae5ef74756b33d35a67b7a6cee44acf79737 (diff)
Related: #i122041# More unifications for FillStyles
better defaults and better preview visualizations (cherry picked from commit 35c9acfc98fc98399005815e0464b1944f327d4e) Conflicts: officecfg/registry/schema/org/openoffice/Office/Common.xcs svtools/inc/svtools/accessibilityoptions.hxx svtools/inc/svtools/valueset.hxx svtools/source/config/accessibilityoptions.cxx svtools/source/control/ctrlbox.cxx svtools/source/control/valueset.cxx svtools/source/inc/configitems/accessibilityoptions_const.hxx svx/inc/svx/dlgctrl.hxx svx/inc/svx/xtable.hxx svx/source/dialog/dlgctrl.cxx svx/source/tbxctrls/SvxColorValueSet.cxx svx/source/xoutdev/xtabdash.cxx svx/source/xoutdev/xtable.cxx vcl/inc/ilstbox.hxx vcl/inc/vcl/combobox.hxx vcl/inc/vcl/lstbox.hxx vcl/inc/vcl/settings.hxx vcl/source/app/settings.cxx vcl/source/control/combobox.cxx vcl/source/control/ilstbox.cxx vcl/source/control/lstbox.cxx Change-Id: I905b6814cb796a35aa23fedb9ce716f77e2bfda0
Diffstat (limited to 'svtools/source/control/valueset.cxx')
-rw-r--r--svtools/source/control/valueset.cxx58
1 files changed, 36 insertions, 22 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 1006bf0d6800..9623b29f4d50 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <rtl/ustring.hxx>
-#include <svtools/accessibilityoptions.hxx>
#include "valueimp.hxx"
#include <svtools/valueset.hxx>
@@ -82,6 +81,7 @@ void ValueSet::ImplInit()
mbDoubleSel = false;
mbScroll = false;
mbFullMode = true;
+ mbEdgeBlending = false;
mbHasVisibleItems = false;
// #106446#, #106601# force mirroring of virtual device
@@ -266,9 +266,10 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
if ( (aRect.GetHeight() > 0) && (aRect.GetWidth() > 0) )
{
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
if ( pItem == mpNoneItem )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
maVirDev.SetFont( GetFont() );
maVirDev.SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() );
maVirDev.SetTextFillColor();
@@ -294,29 +295,9 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
{
maVirDev.SetFillColor( pItem->maColor );
maVirDev.DrawRect( aRect );
-
- const SvtAccessibilityOptions aOptions;
- const sal_Int16 nEdgeBlendingPercent(aOptions.GetEdgeBlending());
- static bool bTest(false);
-
- if(nEdgeBlendingPercent && bTest)
- {
- Bitmap aBitmap(maVirDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()));
-
- if(!aBitmap.IsEmpty())
- {
- const Color aTopLeft(COL_WHITE);
- const Color aBottomRight(COL_BLACK);
- const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
-
- aBitmap.DrawBlendFrame(nAlpha, aTopLeft, aBottomRight);
- maVirDev.DrawBitmap(aRect.TopLeft(), aBitmap);
- }
- }
}
else
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( IsColor() )
maVirDev.SetFillColor( maColor );
else if ( nStyle & WB_MENUSTYLEVALUESET )
@@ -355,6 +336,23 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle );
}
}
+
+ const sal_uInt16 nEdgeBlendingPercent(GetEdgeBlending() ? rStyleSettings.GetEdgeBlending() : 0);
+
+ if(nEdgeBlendingPercent)
+ {
+ Bitmap aBitmap(maVirDev.GetBitmap(aRect.TopLeft(), aRect.GetSize()));
+
+ if(!aBitmap.IsEmpty())
+ {
+ const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor());
+ const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor());
+ const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100);
+
+ aBitmap.DrawBlendFrame(nAlpha, rTopLeft, rBottomRight);
+ maVirDev.DrawBitmap(aRect.TopLeft(), aBitmap);
+ }
+ }
}
}
@@ -2466,4 +2464,20 @@ Size ValueSet::GetOptimalSize() const
return CalcWindowSizePixel(aLargestItemSize);
}
+// -----------------------------------------------------------------------
+
+void ValueSet::SetEdgeBlending(bool bNew)
+{
+ if(mbEdgeBlending != bNew)
+ {
+ mbEdgeBlending = bNew;
+ mbFormat = true;
+
+ if(IsReallyVisible() && IsUpdateMode())
+ {
+ Invalidate();
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */