summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/wall.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-09-09 15:20:07 +0000
committerOliver Bolte <obo@openoffice.org>2004-09-09 15:20:07 +0000
commit5b9ecafa6a6e586dc5b1a82b328897b83e23a242 (patch)
treeb436e496d0e6d6aaafdc104a7e10b67548052023 /vcl/source/gdi/wall.cxx
parent65b8261be00f710ac22ec1ba778037cbe6174f86 (diff)
INTEGRATION: CWS toolbars2 (1.2.162); FILE MERGED
2004/08/16 15:45:16 ssa 1.2.162.1: #32194# provide gradient that covers the application window for use in dockingareas and the menubar
Diffstat (limited to 'vcl/source/gdi/wall.cxx')
-rw-r--r--vcl/source/gdi/wall.cxx35
1 files changed, 29 insertions, 6 deletions
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 38cdf90cb599..06af4973c82a 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wall.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: vg $ $Date: 2004-01-06 13:57:32 $
+ * last change: $Author: obo $ $Date: 2004-09-09 16:20:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,9 @@
#ifndef _SV_WALL2_HXX
#include <wall2.hxx>
#endif
+#ifndef _SV_SVAPP_HXX
+#include <svapp.hxx>
+#endif
DBG_NAME( Wallpaper );
@@ -339,7 +342,7 @@ void Wallpaper::SetColor( const Color& rColor )
ImplMakeUnique();
mpImplWallpaper->maColor = rColor;
- if( WALLPAPER_NULL == mpImplWallpaper->meStyle )
+ if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle )
mpImplWallpaper->meStyle = WALLPAPER_TILE;
}
@@ -359,6 +362,12 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle )
DBG_CHKTHIS( Wallpaper, NULL );
ImplMakeUnique( FALSE );
+
+ if( eStyle == WALLPAPER_APPLICATIONGRADIENT )
+ // set a dummy gradient, the correct gradient
+ // will be created dynamically in GetGradient()
+ SetGradient( ImplGetApplicationGradient() );
+
mpImplWallpaper->meStyle = eStyle;
}
@@ -395,7 +404,7 @@ void Wallpaper::SetBitmap( const BitmapEx& rBitmap )
mpImplWallpaper->mpBitmap = new BitmapEx( rBitmap );
}
- if( WALLPAPER_NULL == mpImplWallpaper->meStyle )
+ if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle)
mpImplWallpaper->meStyle = WALLPAPER_TILE;
}
@@ -451,7 +460,7 @@ void Wallpaper::SetGradient( const Gradient& rGradient )
else
mpImplWallpaper->mpGradient = new Gradient( rGradient );
- if( WALLPAPER_NULL == mpImplWallpaper->meStyle )
+ if( WALLPAPER_NULL == mpImplWallpaper->meStyle || WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle )
mpImplWallpaper->meStyle = WALLPAPER_TILE;
}
@@ -475,7 +484,9 @@ Gradient Wallpaper::GetGradient() const
{
DBG_CHKTHIS( Wallpaper, NULL );
- if ( mpImplWallpaper->mpGradient )
+ if( WALLPAPER_APPLICATIONGRADIENT == mpImplWallpaper->meStyle )
+ return ImplGetApplicationGradient();
+ else if ( mpImplWallpaper->mpGradient )
return *(mpImplWallpaper->mpGradient);
else
{
@@ -496,6 +507,18 @@ BOOL Wallpaper::IsGradient() const
// -----------------------------------------------------------------------
+Gradient Wallpaper::ImplGetApplicationGradient() const
+{
+ Gradient g;
+ g.SetAngle( 900 );
+ g.SetStyle( GRADIENT_LINEAR );
+ g.SetStartColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+ g.SetEndColor( Application::GetSettings().GetStyleSettings().GetFaceGradientColor() );
+ return g;
+}
+
+// -----------------------------------------------------------------------
+
void Wallpaper::SetRect( const Rectangle& rRect )
{
DBG_CHKTHIS( Wallpaper, NULL );