diff --git a/bin/assets/layouts/test.css b/bin/assets/layouts/test.css
index 561d9837b..2e057ec01 100644
--- a/bin/assets/layouts/test.css
+++ b/bin/assets/layouts/test.css
@@ -92,3 +92,14 @@ Tooltip {
opacity: 1;
backgroundColor: #656;
}
+
+#tres {
+ width: 32dp;
+ height: 32dp;
+ transition: all 0.25s;
+}
+
+#tres:hover {
+ width: 128dp;
+ height: 48dp;
+}
diff --git a/bin/assets/layouts/test.xml b/bin/assets/layouts/test.xml
index 355242dee..0d95bffa6 100644
--- a/bin/assets/layouts/test.xml
+++ b/bin/assets/layouts/test.xml
@@ -7,7 +7,7 @@
-
+
- Test
- Test 2
diff --git a/include/eepp/ee.hpp b/include/eepp/ee.hpp
index b10be5f2e..476faadb4 100755
--- a/include/eepp/ee.hpp
+++ b/include/eepp/ee.hpp
@@ -51,8 +51,6 @@
STATE: I've binded some classes with lua+luabind and is awesome, but... luabind is bloated ( and for my needs it's the only good option ), and adds A LOT of compile time.
squirrel+sqrat almost does everything i need, but it have some bugs that seems to be unfixable ( none enum parameters, char parameters segfaults, no constructor overloading ).
- @todo Support UI Theming from scripts or XML.
-
@todo Add some kind of support for TMX map files ( Tiles Map Editor ).
@todo Pathfinding and AI helpers ( A*, FSM ).
diff --git a/include/eepp/scene/actions/actions.hpp b/include/eepp/scene/actions/actions.hpp
index feaa6dd0e..6b9948947 100644
--- a/include/eepp/scene/actions/actions.hpp
+++ b/include/eepp/scene/actions/actions.hpp
@@ -15,7 +15,10 @@
#include
#include
#include
-#include
+#include
+#include
+#include
+#include
#endif
diff --git a/include/eepp/scene/actions/resize.hpp b/include/eepp/scene/actions/resize.hpp
new file mode 100644
index 000000000..120c58cfd
--- /dev/null
+++ b/include/eepp/scene/actions/resize.hpp
@@ -0,0 +1,29 @@
+#ifndef EE_SCENE_ACTIONS_RESIZE_HPP
+#define EE_SCENE_ACTIONS_RESIZE_HPP
+
+#include
+#include
+#include
+
+namespace EE { namespace Scene { namespace Actions {
+
+class EE_API Resize : public ActionInterpolation2d {
+ public:
+ static Resize * New( const Sizef& start, const Sizef& end, const Time& duration, const Ease::Interpolation& type = Ease::Linear );
+
+ Action * clone() const override;
+
+ Action * reverse() const override;
+ protected:
+ Resize( const Sizef& start, const Sizef& end, const Time& duration, const Ease::Interpolation& type );
+
+ void onStart() override;
+
+ void onUpdate( const Time& time ) override;
+ private:
+ Resize();
+};
+
+}}}
+
+#endif
diff --git a/include/eepp/scene/actions/resizeheight.hpp b/include/eepp/scene/actions/resizeheight.hpp
new file mode 100644
index 000000000..217f66316
--- /dev/null
+++ b/include/eepp/scene/actions/resizeheight.hpp
@@ -0,0 +1,28 @@
+#ifndef EE_SCENE_ACTIONS_RESIZEHEIGHT_HPP
+#define EE_SCENE_ACTIONS_RESIZEHEIGHT_HPP
+
+#include
+#include
+
+namespace EE { namespace Scene { namespace Actions {
+
+class EE_API ResizeHeight : public ActionInterpolation1d {
+ public:
+ static ResizeHeight * New( const Float& start, const Float& end, const Time& duration, const Ease::Interpolation& type = Ease::Linear );
+
+ Action * clone() const override;
+
+ Action * reverse() const override;
+ protected:
+ ResizeHeight();
+
+ ResizeHeight( const Float & start, const Float & end, const Time & duration, const Ease::Interpolation & type );
+
+ void onStart() override;
+
+ void onUpdate( const Time& time ) override;
+};
+
+}}}
+
+#endif
diff --git a/include/eepp/scene/actions/resizewidth.hpp b/include/eepp/scene/actions/resizewidth.hpp
new file mode 100644
index 000000000..fb598f67c
--- /dev/null
+++ b/include/eepp/scene/actions/resizewidth.hpp
@@ -0,0 +1,28 @@
+#ifndef EE_SCENE_ACTIONS_RESIZEWIDTH_HPP
+#define EE_SCENE_ACTIONS_RESIZEWIDTH_HPP
+
+#include
+#include
+
+namespace EE { namespace Scene { namespace Actions {
+
+class EE_API ResizeWidth : public ActionInterpolation1d {
+ public:
+ static ResizeWidth * New( const Float& start, const Float& end, const Time& duration, const Ease::Interpolation& type = Ease::Linear );
+
+ Action * clone() const override;
+
+ Action * reverse() const override;
+ protected:
+ ResizeWidth();
+
+ ResizeWidth( const Float & start, const Float & end, const Time & duration, const Ease::Interpolation & type );
+
+ void onStart() override;
+
+ void onUpdate( const Time& time ) override;
+};
+
+}}}
+
+#endif
diff --git a/include/eepp/scene/actions/colorinterpolation.hpp b/include/eepp/scene/actions/tint.hpp
similarity index 68%
rename from include/eepp/scene/actions/colorinterpolation.hpp
rename to include/eepp/scene/actions/tint.hpp
index 7f1ab0315..7d3ddc4d6 100644
--- a/include/eepp/scene/actions/colorinterpolation.hpp
+++ b/include/eepp/scene/actions/tint.hpp
@@ -10,9 +10,9 @@ using namespace EE::Math;
namespace EE { namespace Scene { namespace Actions {
-class EE_API ColorInterpolation : public Action {
+class EE_API Tint : public Action {
public:
- enum ColorInterpolationType {
+ enum TintType {
Background,
Foreground,
Skin,
@@ -20,7 +20,7 @@ class EE_API ColorInterpolation : public Action {
Text
};
- static ColorInterpolation * New( const Color& start, const Color& end, const bool& interpolateAlpha, const Time& duration, const Ease::Interpolation& type = Ease::Linear, const ColorInterpolationType& colorInterpolationType = Background );
+ static Tint * New( const Color& start, const Color& end, const bool& interpolateAlpha, const Time& duration, const Ease::Interpolation& type = Ease::Linear, const TintType& colorInterpolationType = Background );
void start() override;
@@ -50,19 +50,19 @@ class EE_API ColorInterpolation : public Action {
void setInterpolationA(const Interpolation1d & interpolationA);
protected:
- ColorInterpolation( const Color& start, const Color& end, const bool& interpolateAlpha, const Time & duration, const Ease::Interpolation & type, const ColorInterpolationType& colorInterpolationType );
+ Tint( const Color& start, const Color& end, const bool& interpolateAlpha, const Time & duration, const Ease::Interpolation & type, const TintType& colorInterpolationType );
void onStart() override;
virtual void onUpdate( const Time& time ) override;
- ColorInterpolation();
+ Tint();
Interpolation1d mInterpolationR;
Interpolation1d mInterpolationG;
Interpolation1d mInterpolationB;
Interpolation1d mInterpolationA;
- ColorInterpolationType mColorInterpolationType;
+ TintType mColorInterpolationType;
bool mInterpolateAlpha;
};
diff --git a/include/eepp/ui/uiwidget.hpp b/include/eepp/ui/uiwidget.hpp
index b4257a10b..92f080362 100644
--- a/include/eepp/ui/uiwidget.hpp
+++ b/include/eepp/ui/uiwidget.hpp
@@ -174,6 +174,8 @@ class EE_API UIWidget : public UINode, public CSS::StyleSheetElement {
virtual void onVisibilityChange();
+ virtual void onSizeChange();
+
virtual void onAutoSize();
virtual void onWidgetCreated();
diff --git a/projects/linux/ee.files b/projects/linux/ee.files
index 5f1992a6d..e1e61e5f0 100644
--- a/projects/linux/ee.files
+++ b/projects/linux/ee.files
@@ -210,7 +210,6 @@
../../include/eepp/scene/actions/actioninterpolation2d.hpp
../../include/eepp/scene/actions/actions.hpp
../../include/eepp/scene/actions/close.hpp
-../../include/eepp/scene/actions/colorinterpolation.hpp
../../include/eepp/scene/actions/delay.hpp
../../include/eepp/scene/actions/disable.hpp
../../include/eepp/scene/actions/enable.hpp
@@ -218,10 +217,14 @@
../../include/eepp/scene/actions/marginmove.hpp
../../include/eepp/scene/actions/move.hpp
../../include/eepp/scene/actions/paddingtransition.hpp
+../../include/eepp/scene/actions/resize.hpp
+../../include/eepp/scene/actions/resizeheight.hpp
+../../include/eepp/scene/actions/resizewidth.hpp
../../include/eepp/scene/actions/rotate.hpp
../../include/eepp/scene/actions/scale.hpp
../../include/eepp/scene/actions/sequence.hpp
../../include/eepp/scene/actions/spawn.hpp
+../../include/eepp/scene/actions/tint.hpp
../../include/eepp/scene/actions/visible.hpp
../../include/eepp/scene/eventdispatcher.hpp
../../include/eepp/scene/event.hpp
@@ -633,7 +636,6 @@
../../src/eepp/scene/actions/actioninterpolation1d.cpp
../../src/eepp/scene/actions/actioninterpolation2d.cpp
../../src/eepp/scene/actions/close.cpp
-../../src/eepp/scene/actions/colorinterpolation.cpp
../../src/eepp/scene/actions/delay.cpp
../../src/eepp/scene/actions/disable.cpp
../../src/eepp/scene/actions/enable.cpp
@@ -641,10 +643,14 @@
../../src/eepp/scene/actions/marginmove.cpp
../../src/eepp/scene/actions/move.cpp
../../src/eepp/scene/actions/paddingtransition.cpp
+../../src/eepp/scene/actions/resize.cpp
+../../src/eepp/scene/actions/resizeheight.cpp
+../../src/eepp/scene/actions/resizewidth.cpp
../../src/eepp/scene/actions/rotate.cpp
../../src/eepp/scene/actions/scale.cpp
../../src/eepp/scene/actions/sequence.cpp
../../src/eepp/scene/actions/spawn.cpp
+../../src/eepp/scene/actions/tint.cpp
../../src/eepp/scene/actions/visible.cpp
../../src/eepp/scene/event.cpp
../../src/eepp/scene/eventdispatcher.cpp
diff --git a/src/eepp/scene/actions/fade.cpp b/src/eepp/scene/actions/fade.cpp
index 25c67ca75..5ae499591 100644
--- a/src/eepp/scene/actions/fade.cpp
+++ b/src/eepp/scene/actions/fade.cpp
@@ -32,7 +32,7 @@ void Fade::onStart() {
}
}
-void Fade::onUpdate( const Time& time ) {
+void Fade::onUpdate( const Time& ) {
if ( NULL != mNode ) {
mNode->setAlpha( mInterpolation.getPosition() );
}
diff --git a/src/eepp/scene/actions/resize.cpp b/src/eepp/scene/actions/resize.cpp
new file mode 100644
index 000000000..df50b2b60
--- /dev/null
+++ b/src/eepp/scene/actions/resize.cpp
@@ -0,0 +1,39 @@
+#include
+#include
+
+namespace EE { namespace Scene { namespace Actions {
+
+Resize * Resize::New( const Sizef& start, const Sizef& end, const Time& duration, const Ease::Interpolation& type ) {
+ return eeNew( Resize, ( start, end, duration, type ) );
+}
+
+Resize::Resize()
+{}
+
+Resize::Resize( const Sizef & start, const Sizef & end, const Time& duration, const Ease::Interpolation& type ) {
+ mInterpolation.clear().add( start, duration ).add( end ).setType( type );
+}
+
+void Resize::onStart() {
+ onUpdate( Time::Zero );
+}
+
+void Resize::onUpdate( const Time& ) {
+ if ( NULL != mNode ) {
+ mNode->setSize( mInterpolation.getPosition() );
+ }
+}
+
+Action * Resize::clone() const {
+ Resize * action = eeNew( Resize, () );
+ action->setInterpolation( mInterpolation );
+ return action;
+}
+
+Action * Resize::reverse() const {
+ Resize * action = eeNew( Resize, () );
+ action->setInterpolation( mInterpolation.getReversePoints() );
+ return action;
+}
+
+}}}
diff --git a/src/eepp/scene/actions/resizeheight.cpp b/src/eepp/scene/actions/resizeheight.cpp
new file mode 100644
index 000000000..e9ba371af
--- /dev/null
+++ b/src/eepp/scene/actions/resizeheight.cpp
@@ -0,0 +1,46 @@
+#include
+#include
+#include
+using namespace EE::UI;
+
+namespace EE { namespace Scene { namespace Actions {
+
+ResizeHeight * ResizeHeight::New( const Float & start, const Float & end, const Time& duration, const Ease::Interpolation& type ) {
+ return eeNew( ResizeHeight, ( start, end, duration, type ) );
+}
+
+ResizeHeight::ResizeHeight()
+{}
+
+ResizeHeight::ResizeHeight( const Float & start, const Float & end, const Time& duration, const Ease::Interpolation& type ) {
+ mInterpolation.clear().add( start, duration ).add( end ).setType( type );
+}
+
+void ResizeHeight::onStart() {
+ onUpdate( Time::Zero );
+}
+
+void ResizeHeight::onUpdate( const Time& ) {
+ if ( NULL != mNode ) {
+ mNode->setSize( mNode->getSize().getWidth(), mInterpolation.getPosition() );
+
+ /** TODO: Remove this when onSizeChange notifyLayoutAttrChange calls is enabled */
+ if ( mNode->isWidget() ) {
+ static_cast( mNode )->notifyLayoutAttrChange();
+ }
+ }
+}
+
+Action * ResizeHeight::clone() const {
+ ResizeHeight * action = eeNew( ResizeHeight, () );
+ action->setInterpolation( mInterpolation );
+ return action;
+}
+
+Action * ResizeHeight::reverse() const {
+ ResizeHeight * action = eeNew( ResizeHeight, () );
+ action->setInterpolation( Interpolation1d( mInterpolation.getReversePoints() ) );
+ return action;
+}
+
+}}}
diff --git a/src/eepp/scene/actions/resizewidth.cpp b/src/eepp/scene/actions/resizewidth.cpp
new file mode 100644
index 000000000..ef5fc68f8
--- /dev/null
+++ b/src/eepp/scene/actions/resizewidth.cpp
@@ -0,0 +1,46 @@
+#include
+#include
+#include
+using namespace EE::UI;
+
+namespace EE { namespace Scene { namespace Actions {
+
+ResizeWidth * ResizeWidth::New( const Float & start, const Float & end, const Time& duration, const Ease::Interpolation& type ) {
+ return eeNew( ResizeWidth, ( start, end, duration, type ) );
+}
+
+ResizeWidth::ResizeWidth()
+{}
+
+ResizeWidth::ResizeWidth( const Float & start, const Float & end, const Time& duration, const Ease::Interpolation& type ) {
+ mInterpolation.clear().add( start, duration ).add( end ).setType( type );
+}
+
+void ResizeWidth::onStart() {
+ onUpdate( Time::Zero );
+}
+
+void ResizeWidth::onUpdate( const Time& ) {
+ if ( NULL != mNode ) {
+ mNode->setSize( mInterpolation.getPosition(), mNode->getSize().getHeight() );
+
+ /** TODO: Remove this when onSizeChange notifyLayoutAttrChange calls is enabled */
+ if ( mNode->isWidget() ) {
+ static_cast( mNode )->notifyLayoutAttrChange();
+ }
+ }
+}
+
+Action * ResizeWidth::clone() const {
+ ResizeWidth * action = eeNew( ResizeWidth, () );
+ action->setInterpolation( mInterpolation );
+ return action;
+}
+
+Action * ResizeWidth::reverse() const {
+ ResizeWidth * action = eeNew( ResizeWidth, () );
+ action->setInterpolation( Interpolation1d( mInterpolation.getReversePoints() ) );
+ return action;
+}
+
+}}}
diff --git a/src/eepp/scene/actions/scale.cpp b/src/eepp/scene/actions/scale.cpp
index b08e6868d..70016fb52 100644
--- a/src/eepp/scene/actions/scale.cpp
+++ b/src/eepp/scene/actions/scale.cpp
@@ -15,12 +15,10 @@ Scale::Scale( const Vector2f & start, const Vector2f & end, const Time& duration
}
void Scale::onStart() {
- if ( NULL != mNode ) {
- mNode->setScale( mInterpolation.getPosition() );
- }
+ onUpdate( Time::Zero );
}
-void Scale::onUpdate( const Time& time ) {
+void Scale::onUpdate( const Time& ) {
if ( NULL != mNode ) {
mNode->setScale( mInterpolation.getPosition() );
}
diff --git a/src/eepp/scene/actions/colorinterpolation.cpp b/src/eepp/scene/actions/tint.cpp
similarity index 68%
rename from src/eepp/scene/actions/colorinterpolation.cpp
rename to src/eepp/scene/actions/tint.cpp
index a6cda17a3..31163cc67 100644
--- a/src/eepp/scene/actions/colorinterpolation.cpp
+++ b/src/eepp/scene/actions/tint.cpp
@@ -1,50 +1,50 @@
-#include
+#include
#include
#include
using namespace EE::UI;
namespace EE { namespace Scene { namespace Actions {
-ColorInterpolation * ColorInterpolation::New( const Color& start, const Color& end, const bool& interpolateAlpha, const Time& duration, const Ease::Interpolation& type, const ColorInterpolationType& colorInterpolationType ) {
- return eeNew( ColorInterpolation, ( start, end, interpolateAlpha, duration, type, colorInterpolationType ) );
+Tint * Tint::New( const Color& start, const Color& end, const bool& interpolateAlpha, const Time& duration, const Ease::Interpolation& type, const TintType& colorInterpolationType ) {
+ return eeNew( Tint, ( start, end, interpolateAlpha, duration, type, colorInterpolationType ) );
}
-ColorInterpolation::ColorInterpolation()
+Tint::Tint()
{}
-Interpolation1d ColorInterpolation::getInterpolationA() const {
+Interpolation1d Tint::getInterpolationA() const {
return mInterpolationA;
}
-void ColorInterpolation::setInterpolationA(const Interpolation1d & interpolationA) {
+void Tint::setInterpolationA(const Interpolation1d & interpolationA) {
mInterpolationA = interpolationA;
}
-Interpolation1d ColorInterpolation::getInterpolationB() const {
+Interpolation1d Tint::getInterpolationB() const {
return mInterpolationB;
}
-void ColorInterpolation::setInterpolationB(const Interpolation1d& interpolationB) {
+void Tint::setInterpolationB(const Interpolation1d& interpolationB) {
mInterpolationB = interpolationB;
}
-Interpolation1d ColorInterpolation::getInterpolationG() const {
+Interpolation1d Tint::getInterpolationG() const {
return mInterpolationG;
}
-void ColorInterpolation::setInterpolationG(const Interpolation1d & interpolationG) {
+void Tint::setInterpolationG(const Interpolation1d & interpolationG) {
mInterpolationG = interpolationG;
}
-Interpolation1d ColorInterpolation::getInterpolationR() const {
+Interpolation1d Tint::getInterpolationR() const {
return mInterpolationR;
}
-void ColorInterpolation::setInterpolationR(const Interpolation1d & interpolationR) {
+void Tint::setInterpolationR(const Interpolation1d & interpolationR) {
mInterpolationR = interpolationR;
}
-ColorInterpolation::ColorInterpolation( const Color& start, const Color & end, const bool& interpolateAlpha, const Time& duration, const Ease::Interpolation& type, const ColorInterpolationType& colorInterpolationType ) :
+Tint::Tint( const Color& start, const Color & end, const bool& interpolateAlpha, const Time& duration, const Ease::Interpolation& type, const TintType& colorInterpolationType ) :
mColorInterpolationType( colorInterpolationType ),
mInterpolateAlpha( interpolateAlpha )
{
@@ -56,7 +56,7 @@ ColorInterpolation::ColorInterpolation( const Color& start, const Color & end, c
mInterpolationA.clear().add( start.a, duration ).add( end.a ).setType( type );
}
-void ColorInterpolation::start() {
+void Tint::start() {
mInterpolationR.start();
mInterpolationG.start();
mInterpolationB.start();
@@ -69,7 +69,7 @@ void ColorInterpolation::start() {
sendEvent( ActionType::OnStart );
}
-void ColorInterpolation::stop() {
+void Tint::stop() {
mInterpolationR.stop();
mInterpolationG.stop();
mInterpolationB.stop();
@@ -82,7 +82,7 @@ void ColorInterpolation::stop() {
sendEvent( ActionType::OnStop );
}
-void ColorInterpolation::update( const Time& time ) {
+void Tint::update( const Time& time ) {
mInterpolationR.update( time );
mInterpolationG.update( time );
mInterpolationB.update( time );
@@ -91,7 +91,7 @@ void ColorInterpolation::update( const Time& time ) {
onUpdate( time );
}
-bool ColorInterpolation::isDone() {
+bool Tint::isDone() {
return mInterpolationR.ended() &&
mInterpolationG.ended() &&
mInterpolationB.ended() && (
@@ -100,14 +100,14 @@ bool ColorInterpolation::isDone() {
}
-void ColorInterpolation::onStart() {
+void Tint::onStart() {
if ( NULL != mNode && mNode->isWidget() ) {
onUpdate( Time::Zero );
}
}
-Action * ColorInterpolation::clone() const {
- ColorInterpolation * action = eeNew( ColorInterpolation, () );
+Action * Tint::clone() const {
+ Tint * action = eeNew( Tint, () );
action->setInterpolationR( mInterpolationR );
action->setInterpolationG( mInterpolationG );
action->setInterpolationB( mInterpolationB );
@@ -115,11 +115,11 @@ Action * ColorInterpolation::clone() const {
return action;
}
-Action * ColorInterpolation::reverse() const {
+Action * Tint::reverse() const {
return NULL;
}
-void ColorInterpolation::onUpdate( const Time& ) {
+void Tint::onUpdate( const Time& ) {
if ( NULL != mNode && mNode->isWidget() ) {
UIWidget * widget = static_cast( mNode );
diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp
index 9276cee74..44a9bd4db 100644
--- a/src/eepp/ui/uidropdownlist.cpp
+++ b/src/eepp/ui/uidropdownlist.cpp
@@ -64,12 +64,10 @@ void UIDropDownList::onSizeChange() {
}
void UIDropDownList::autoSizeControl() {
- if ( ( mFlags & UI_AUTO_SIZE || 0 == mDpSize.getHeight() ) && 0 != getSkinSize().getHeight() ) {
- setSize( mDpSize.x, getSkinSize().getHeight() );
- }
-
if ( mLayoutHeightRules == WRAP_CONTENT ) {
setInternalPixelsHeight( PixelDensity::dpToPxI( getSkinSize().getHeight() ) + mRealPadding.Top + mRealPadding.Bottom );
+ } else if ( ( mFlags & UI_AUTO_SIZE || 0 == mDpSize.getHeight() ) && 0 != getSkinSize().getHeight() ) {
+ setSize( mDpSize.x, getSkinSize().getHeight() );
}
}
diff --git a/src/eepp/ui/uiwidget.cpp b/src/eepp/ui/uiwidget.cpp
index 556f26343..948597f5d 100644
--- a/src/eepp/ui/uiwidget.cpp
+++ b/src/eepp/ui/uiwidget.cpp
@@ -271,7 +271,7 @@ UINode * UIWidget::setFlags(const Uint32 & flags) {
updateAnchorsDistances();
}
- if ( flags & UI_AUTO_SIZE ) {
+ if ( !( mFlags & UI_AUTO_SIZE ) && ( flags & UI_AUTO_SIZE ) ) {
onAutoSize();
}
@@ -342,6 +342,12 @@ void UIWidget::onVisibilityChange() {
UINode::onVisibilityChange();
}
+void UIWidget::onSizeChange() {
+ /** TODO: Fix this. notifyLayoutAttrChange should be called but UI_AUTO_SIZE generates a resize recursion */
+ //notifyLayoutAttrChange();
+ UINode::onSizeChange();
+}
+
void UIWidget::onAutoSize() {
}
@@ -594,13 +600,41 @@ bool UIWidget::setAttribute( const NodeAttribute& attribute, const Uint32& state
} else if ( "y" == name ) {
setInternalPosition( Vector2f( mDpPos.x, attribute.asDpDimension() ) );
} else if ( "width" == name ) {
- setLayoutWidthRules( FIXED );
- setInternalWidth( attribute.asDpDimensionI() );
- notifyLayoutAttrChange();
+ Float newWidth = attribute.asDpDimensionI();
+
+ if ( !isSceneNodeLoading() && NULL != mStyle && mStyle->hasTransition( state, attribute.getName() ) ) {
+ UIStyle::TransitionInfo transitionInfo( mStyle->getTransition( state, attribute.getName() ) );
+ Float start( getSize().getWidth() );
+
+ Action * action = Actions::ResizeWidth::New( start, newWidth, transitionInfo.duration, transitionInfo.timingFunction );
+
+ if ( Time::Zero != transitionInfo.delay )
+ action = Actions::Sequence::New( Actions::Delay::New( transitionInfo.delay ), action );
+
+ runAction( action );
+ } else {
+ setLayoutWidthRules( FIXED );
+ setInternalWidth( newWidth );
+ notifyLayoutAttrChange();
+ }
} else if ( "height" == name ) {
- setLayoutHeightRules( FIXED );
- setInternalHeight( attribute.asDpDimensionI() );
- notifyLayoutAttrChange();
+ Float newHeight = attribute.asDpDimensionI();
+
+ if ( !isSceneNodeLoading() && NULL != mStyle && mStyle->hasTransition( state, attribute.getName() ) ) {
+ UIStyle::TransitionInfo transitionInfo( mStyle->getTransition( state, attribute.getName() ) );
+ Float start( getSize().getHeight() );
+
+ Action * action = Actions::ResizeHeight::New( start, newHeight, transitionInfo.duration, transitionInfo.timingFunction );
+
+ if ( Time::Zero != transitionInfo.delay )
+ action = Actions::Sequence::New( Actions::Delay::New( transitionInfo.delay ), action );
+
+ runAction( action );
+ } else {
+ setLayoutHeightRules( FIXED );
+ setInternalHeight( newHeight );
+ notifyLayoutAttrChange();
+ }
} else if ( "background" == name ) {
Drawable * res = NULL;
@@ -618,7 +652,7 @@ bool UIWidget::setAttribute( const NodeAttribute& attribute, const Uint32& state
UIStyle::TransitionInfo transitionInfo( mStyle->getTransition( state, attribute.getName() ) );
Color start( getBackgroundColor( getStylePreviousState() ) );
- Action * action = Actions::ColorInterpolation::New( start, color, false, transitionInfo.duration, transitionInfo.timingFunction, Actions::ColorInterpolation::Background );
+ Action * action = Actions::Tint::New( start, color, false, transitionInfo.duration, transitionInfo.timingFunction, Actions::Tint::Background );
if ( Time::Zero != transitionInfo.delay )
action = Actions::Sequence::New( Actions::Delay::New( transitionInfo.delay ), action );
@@ -644,7 +678,7 @@ bool UIWidget::setAttribute( const NodeAttribute& attribute, const Uint32& state
UIStyle::TransitionInfo transitionInfo( mStyle->getTransition( state, attribute.getName() ) );
Color start( getForegroundColor( getStylePreviousState() ) );
- Action * action = Actions::ColorInterpolation::New( start, color, false, transitionInfo.duration, transitionInfo.timingFunction, Actions::ColorInterpolation::Foreground );
+ Action * action = Actions::Tint::New( start, color, false, transitionInfo.duration, transitionInfo.timingFunction, Actions::Tint::Foreground );
if ( Time::Zero != transitionInfo.delay )
action = Actions::Sequence::New( Actions::Delay::New( transitionInfo.delay ), action );
@@ -662,7 +696,7 @@ bool UIWidget::setAttribute( const NodeAttribute& attribute, const Uint32& state
UIStyle::TransitionInfo transitionInfo( mStyle->getTransition( state, attribute.getName() ) );
Color start( getBorderColor( getStylePreviousState() ) );
- Action * action = Actions::ColorInterpolation::New( start, color, false, transitionInfo.duration, transitionInfo.timingFunction, Actions::ColorInterpolation::Border );
+ Action * action = Actions::Tint::New( start, color, false, transitionInfo.duration, transitionInfo.timingFunction, Actions::Tint::Border );
if ( Time::Zero != transitionInfo.delay )
action = Actions::Sequence::New( Actions::Delay::New( transitionInfo.delay ), action );
diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp
index cf7b69109..42eea29b7 100644
--- a/src/eepp/ui/uiwindow.cpp
+++ b/src/eepp/ui/uiwindow.cpp
@@ -1446,7 +1446,7 @@ bool UIWindow::setAttribute( const NodeAttribute& attribute, const Uint32& state
else if ( "colorbuffer"== cur ) winflags |= UI_WIN_COLOR_BUFFER;
}
- /// @TODO: FIX ME
+ /// TODO: WinFlags should replace old winFlags
mStyleConfig.WinFlags |= winflags;
updateWinFlags();
}