Kaydet (Commit) d8005bec authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS c01v006 (1.12.30); FILE MERGED

2005/04/27 10:59:02 pb 1.12.30.1: fix: #120401# separate colors (bar and frame)
üst cee0f623
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: splash.cxx,v $ * $RCSfile: splash.cxx,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: rt $ $Date: 2005-03-30 08:49:22 $ * last change: $Author: rt $ $Date: 2005-05-13 08:25:47 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -95,7 +95,8 @@ namespace desktop ...@@ -95,7 +95,8 @@ namespace desktop
SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr) SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr)
: IntroWindow() : IntroWindow()
, _vdev(*((IntroWindow*)this)) , _vdev(*((IntroWindow*)this))
, _cProgressColor( -1 ) , _cProgressFrameColor( -1 )
, _cProgressBarColor( -1 )
, _iProgress(0) , _iProgress(0)
, _iMax(100) , _iMax(100)
, _bPaintBitmap(sal_True) , _bPaintBitmap(sal_True)
...@@ -148,13 +149,16 @@ SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr) ...@@ -148,13 +149,16 @@ SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr)
} }
} }
if ( -1 == _cProgressColor.GetColor() ) if ( -1 == _cProgressFrameColor.GetColor() )
_cProgressFrameColor = Color( COL_LIGHTGRAY );
if ( -1 == _cProgressBarColor.GetColor() )
{ {
// progress bar: new color only for big bitmap format // progress bar: new color only for big bitmap format
if ( _width > 500 ) if ( _width > 500 )
_cProgressColor = Color( 157, 202, 18 ); _cProgressBarColor = Color( 157, 202, 18 );
else else
_cProgressColor = Color( COL_BLUE ); _cProgressBarColor = Color( COL_BLUE );
} }
Application::AddEventListener( Application::AddEventListener(
...@@ -275,30 +279,52 @@ void SplashScreen::loadConfig() ...@@ -275,30 +279,52 @@ void SplashScreen::loadConfig()
sIniFileName += OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_CONFIGFILE( "soffice" ) ) ); sIniFileName += OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_CONFIGFILE( "soffice" ) ) );
rtl::Bootstrap aIniFile( sIniFileName ); rtl::Bootstrap aIniFile( sIniFileName );
OUString sProgressColor = implReadBootstrapKey( OUString sProgressFrameColor = implReadBootstrapKey(
aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressColor" ) ) ); aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressFrameColor" ) ) );
OUString sProgressBarColor = implReadBootstrapKey(
aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressBarColor" ) ) );
OUString sSize = implReadBootstrapKey( OUString sSize = implReadBootstrapKey(
aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressSize" ) ) ); aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressSize" ) ) );
OUString sPosition = implReadBootstrapKey( OUString sPosition = implReadBootstrapKey(
aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) ); aIniFile, OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) );
if ( sProgressColor.getLength() ) if ( sProgressFrameColor.getLength() )
{ {
UINT8 nRed = 0; UINT8 nRed = 0;
UINT8 nGreen = 0; UINT8 nGreen = 0;
UINT8 nBlue = 0; UINT8 nBlue = 0;
sal_Int32 idx = 0; sal_Int32 idx = 0;
sal_Int32 temp = sProgressColor.getToken( 0, ',', idx ).toInt32(); sal_Int32 temp = sProgressFrameColor.getToken( 0, ',', idx ).toInt32();
if ( idx != -1 ) if ( idx != -1 )
{ {
nRed = static_cast< UINT8 >( temp ); nRed = static_cast< UINT8 >( temp );
temp = sProgressColor.getToken( 0, ',', idx ).toInt32(); temp = sProgressFrameColor.getToken( 0, ',', idx ).toInt32();
} }
if ( idx != -1 ) if ( idx != -1 )
{ {
nGreen = static_cast< UINT8 >( temp ); nGreen = static_cast< UINT8 >( temp );
nBlue = static_cast< UINT8 >( sProgressColor.getToken( 0, ',', idx ).toInt32() ); nBlue = static_cast< UINT8 >( sProgressFrameColor.getToken( 0, ',', idx ).toInt32() );
_cProgressColor = Color( nRed, nGreen, nBlue ); _cProgressFrameColor = Color( nRed, nGreen, nBlue );
}
}
if ( sProgressBarColor.getLength() )
{
UINT8 nRed = 0;
UINT8 nGreen = 0;
UINT8 nBlue = 0;
sal_Int32 idx = 0;
sal_Int32 temp = sProgressBarColor.getToken( 0, ',', idx ).toInt32();
if ( idx != -1 )
{
nRed = static_cast< UINT8 >( temp );
temp = sProgressBarColor.getToken( 0, ',', idx ).toInt32();
}
if ( idx != -1 )
{
nGreen = static_cast< UINT8 >( temp );
nBlue = static_cast< UINT8 >( sProgressBarColor.getToken( 0, ',', idx ).toInt32() );
_cProgressBarColor = Color( nRed, nGreen, nBlue );
} }
} }
...@@ -313,6 +339,9 @@ void SplashScreen::loadConfig() ...@@ -313,6 +339,9 @@ void SplashScreen::loadConfig()
} }
} }
if ( _barheight >= 10 )
_barspace = 3; // more space between frame and bar
if ( sPosition.getLength() ) if ( sPosition.getLength() )
{ {
sal_Int32 idx = 0; sal_Int32 idx = 0;
...@@ -388,10 +417,11 @@ void SplashScreen::Paint( const Rectangle& r) ...@@ -388,10 +417,11 @@ void SplashScreen::Paint( const Rectangle& r)
// border // border
_vdev.SetFillColor(); _vdev.SetFillColor();
_vdev.SetLineColor( Color( COL_LIGHTGRAY ) ); _vdev.SetLineColor( _cProgressFrameColor );
_vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight)); _vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight));
_vdev.SetFillColor( _cProgressColor ); _vdev.SetFillColor( _cProgressBarColor );
_vdev.SetLineColor(); _vdev.SetLineColor();
Rectangle aRect(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace);
_vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace,
_tlx+_barspace+length, _tly+_barheight-_barspace)); _tlx+_barspace+length, _tly+_barheight-_barspace));
} }
......
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