From 5df2ec9703a12a9cfd51c0f4204dfd3088209dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 13 Jan 2019 18:47:06 -0300 Subject: [PATCH] Widget "background" attribute fix. --HG-- branch : dev --- bin/assets/layouts/test.xml | 6 +++--- src/eepp/ui/uiwidget.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/assets/layouts/test.xml b/bin/assets/layouts/test.xml index 9bc4df723..5627678a5 100644 --- a/bin/assets/layouts/test.xml +++ b/bin/assets/layouts/test.xml @@ -36,11 +36,11 @@ - + - + - + diff --git a/src/eepp/ui/uiwidget.cpp b/src/eepp/ui/uiwidget.cpp index 67c66d746..dbbe96035 100644 --- a/src/eepp/ui/uiwidget.cpp +++ b/src/eepp/ui/uiwidget.cpp @@ -700,7 +700,7 @@ bool UIWidget::setAttribute( const NodeAttribute& attribute, const Uint32& state } else if ( "background" == name ) { Drawable * res = NULL; - if ( String::startsWith( name, "#" ) ) { + if ( String::startsWith( attribute.getValue(), "#" ) ) { setAttribute( NodeAttribute( "backgroundcolor", attribute.getValue() ) ); } else if ( NULL != ( res = DrawableSearcher::searchByName( name ) ) ) { setBackgroundDrawable( state, res, res->getDrawableType() == Drawable::SPRITE ); @@ -764,7 +764,7 @@ bool UIWidget::setAttribute( const NodeAttribute& attribute, const Uint32& state } else if ( "foreground" == name ) { Drawable * res = NULL; - if ( String::startsWith( name, "#" ) ) { + if ( String::startsWith( attribute.getValue(), "#" ) ) { setAttribute( NodeAttribute( "foregroundcolor", attribute.getValue() ) ); } else if ( NULL != ( res = DrawableSearcher::searchByName( attribute.getValue() ) ) ) { setForegroundDrawable( state, res, res->getDrawableType() == Drawable::SPRITE );