Mercurial > projects > dwt-addons
diff dwtx/draw2d/FrameBorder.d @ 103:2d6540440fe6
Replace static ctors with lazy init.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 17:01:51 +0200 |
parents | 95307ad235d9 |
children |
line wrap: on
line diff
--- a/dwtx/draw2d/FrameBorder.d Sun Aug 03 03:07:30 2008 +0200 +++ b/dwtx/draw2d/FrameBorder.d Sun Aug 03 17:01:51 2008 +0200 @@ -36,23 +36,28 @@ * The border scheme that determines the border highlight and shadow colors, as well as * the border width (3). */ -protected static const SchemeBorder.Scheme - SCHEME_FRAME; -static this(){ - SCHEME_FRAME = new SchemeBorder.Scheme( - [ +private static SchemeBorder.Scheme SCHEME_FRAME_; +protected static SchemeBorder.Scheme SCHEME_FRAME(){ + if( SCHEME_FRAME_ is null ){ + synchronized( FrameBorder.classinfo ){ + if( SCHEME_FRAME_ is null ){ + SCHEME_FRAME_ = new SchemeBorder.Scheme( + [ ColorConstants.button, ColorConstants.buttonLightest, ColorConstants.button - ], - [ + ], + [ ColorConstants.buttonDarkest, ColorConstants.buttonDarker, ColorConstants.button - ] - ); + ] + ); + } + } + } + return SCHEME_FRAME_; } - private void instanceInit(){ createBorders(); }