From 22153f233e289227ae2c70d75a0fcbd04fb10082 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Fri, 25 Nov 2016 10:27:35 +0000 Subject: [PATCH] Control - Trigger the size negotiation when the background is updated. * It may be needed by the new visual to relayout its contents. i.e TextVisual needs it. Change-Id: I04498ed72b2ef94cccc2b3135adb66f5d2862e2d Signed-off-by: Victor Cebollada --- dali-toolkit/public-api/controls/control-impl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index 2bc13bed5e..02bbf97529 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -584,6 +584,9 @@ void Control::SetBackground( const Property::Map& map ) { RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual ); visual.SetDepthIndex( DepthIndex::BACKGROUND ); + + // Trigger a size negotiation request that may be needed by the new visual to relayout its contents. + RelayoutRequest(); } } @@ -602,6 +605,9 @@ void Control::ClearBackground() { UnregisterVisual( Toolkit::Control::Property::BACKGROUND ); mImpl->mBackgroundColor = Color::TRANSPARENT; + + // Trigger a size negotiation request that may be needed when unregistering a visual. + RelayoutRequest(); } void Control::EnableGestureDetection(Gesture::Type type) -- 2.34.1