- Dali::Property::Map map;
- map["rendererType"] = "IMAGE";
- map["url"] = BACKGROUND_IMAGE;
- background.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
- stage.Add( background );
+
+ // Set up the background gradient.
+ Property::Array stopOffsets;
+ stopOffsets.PushBack( 0.0f );
+ stopOffsets.PushBack( 1.0f );
+ Property::Array stopColors;
+ stopColors.PushBack( Vector4( 0.17f, 0.24f, 0.35f, 1.0f ) ); // Dark, medium saturated blue ( top of screen)
+ stopColors.PushBack( Vector4( 0.45f, 0.70f, 0.80f, 1.0f ) ); // Medium bright, pastel blue (bottom of screen)
+ const float percentageWindowHeight = window.GetSize().GetHeight() * 0.7f;
+
+ background.SetProperty( Toolkit::Control::Property::BACKGROUND, Dali::Property::Map()
+ .Add( Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT )
+ .Add( Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets )
+ .Add( Toolkit::GradientVisual::Property::STOP_COLOR, stopColors )
+ .Add( Toolkit::GradientVisual::Property::START_POSITION, Vector2( 0.0f, -percentageWindowHeight ) )
+ .Add( Toolkit::GradientVisual::Property::END_POSITION, Vector2( 0.0f, percentageWindowHeight ) )
+ .Add( Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE ) );
+
+ window.Add( background );