Added onMenuScroll animation, which activates once every time the menu starts scrolling.

This commit is contained in:
Pieter Hulshoff
2016-08-11 15:31:13 +02:00
parent 9e7802c72e
commit 5abfe6d205
3 changed files with 23 additions and 0 deletions

View File

@@ -325,6 +325,19 @@ void Page::playlistChange()
} }
void Page::menuScroll()
{
Item *item = selectedItem_;
if(!item) return;
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
{
(*it)->triggerEvent( "menuScroll", menuDepth_ - 1 );
}
}
void Page::highlightEnter() void Page::highlightEnter()
{ {
Item *item = selectedItem_; Item *item = selectedItem_;
@@ -371,10 +384,18 @@ void Page::setScrolling(ScrollDirection direction)
switch(direction) switch(direction)
{ {
case ScrollDirectionForward: case ScrollDirectionForward:
if(!scrollActive_)
{
menuScroll();
}
menuDirection = ScrollingList::ScrollDirectionForward; menuDirection = ScrollingList::ScrollDirectionForward;
scrollActive_ = true; scrollActive_ = true;
break; break;
case ScrollDirectionBack: case ScrollDirectionBack:
if(!scrollActive_)
{
menuScroll();
}
menuDirection = ScrollingList::ScrollDirectionBack; menuDirection = ScrollingList::ScrollDirectionBack;
scrollActive_ = true; scrollActive_ = true;
break; break;

View File

@@ -86,6 +86,7 @@ public:
std::string getCollectionName(); std::string getCollectionName();
void setMinShowTime(float value); void setMinShowTime(float value);
float getMinShowTime(); float getMinShowTime();
void menuScroll();
void highlightEnter(); void highlightEnter();
void highlightExit(); void highlightExit();
void addPlaylist(); void addPlaylist();

View File

@@ -704,6 +704,7 @@ AnimationEvents *PageBuilder::createTweenInstance(xml_node<> *componentXml)
buildTweenSet(tweens, componentXml, "onEnter", "enter"); buildTweenSet(tweens, componentXml, "onEnter", "enter");
buildTweenSet(tweens, componentXml, "onExit", "exit"); buildTweenSet(tweens, componentXml, "onExit", "exit");
buildTweenSet(tweens, componentXml, "onIdle", "idle"); buildTweenSet(tweens, componentXml, "onIdle", "idle");
buildTweenSet(tweens, componentXml, "onMenuScroll", "menuScroll");
buildTweenSet(tweens, componentXml, "onHighlightEnter", "highlightEnter"); buildTweenSet(tweens, componentXml, "onHighlightEnter", "highlightEnter");
buildTweenSet(tweens, componentXml, "onHighlightExit", "highlightExit"); buildTweenSet(tweens, componentXml, "onHighlightExit", "highlightExit");
buildTweenSet(tweens, componentXml, "onMenuEnter", "menuEnter"); buildTweenSet(tweens, componentXml, "onMenuEnter", "menuEnter");