add xml events onMenuFastScrollPrev onMenuFastScrollNext onMenuScrollPrev onMenuScrollNext

Signed-off-by: Vincent-FK <vincent.buso@funkey-project.com>
This commit is contained in:
Vincent-FK 2020-03-22 11:14:04 +01:00
parent bcac9e6f4d
commit 71d439c3f7
3 changed files with 12 additions and 2 deletions

View File

@ -893,6 +893,8 @@ void ScrollingList::scroll( bool forward )
resetTweens( c, tweenPoints_->at( nextI ), scrollPoints_->at( i ), scrollPoints_->at( nextI ), scrollPeriod_ ); resetTweens( c, tweenPoints_->at( nextI ), scrollPoints_->at( i ), scrollPoints_->at( nextI ), scrollPeriod_ );
c->baseViewInfo.font = scrollPoints_->at( nextI )->font; // Use the font settings of the next index c->baseViewInfo.font = scrollPoints_->at( nextI )->font; // Use the font settings of the next index
c->triggerEvent( forward?"menuScrollNext":"menuScrollPrev" );
c->update(0);
c->triggerEvent( "menuScroll" ); c->triggerEvent( "menuScroll" );
} }

View File

@ -444,6 +444,8 @@ void Page::menuScroll()
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it) for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
{ {
(*it)->triggerEvent( scrollDirectionForward_?"menuScrollNext":"menuScrollPrev", menuDepth_ - 1 );
(*it)->update(0);
(*it)->triggerEvent( "menuScroll", menuDepth_ - 1 ); (*it)->triggerEvent( "menuScroll", menuDepth_ - 1 );
} }
} }
@ -457,6 +459,8 @@ void Page::menuFastScroll()
for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it) for(std::vector<Component *>::iterator it = LayerComponents.begin(); it != LayerComponents.end(); ++it)
{ {
(*it)->triggerEvent( scrollDirectionForward_?"menuFastScrollNext":"menuFastScrollPrev", menuDepth_ - 1 );
(*it)->update(0);
(*it)->triggerEvent( "menuFastScroll", menuDepth_ - 1 ); (*it)->triggerEvent( "menuFastScroll", menuDepth_ - 1 );
} }
} }
@ -671,6 +675,7 @@ void Page::setScrolling(ScrollDirection direction)
switch(direction) switch(direction)
{ {
case ScrollDirectionForward: case ScrollDirectionForward:
scrollDirectionForward_=true;
if(!scrollActive_) if(!scrollActive_)
{ {
menuScroll(); menuScroll();
@ -679,9 +684,9 @@ void Page::setScrolling(ScrollDirection direction)
menuFastScroll(); menuFastScroll();
} }
scrollActive_ = true; scrollActive_ = true;
scrollDirectionForward_=true;
break; break;
case ScrollDirectionBack: case ScrollDirectionBack:
scrollDirectionForward_=false;
if(!scrollActive_) if(!scrollActive_)
{ {
menuScroll(); menuScroll();
@ -690,7 +695,6 @@ void Page::setScrolling(ScrollDirection direction)
menuFastScroll(); menuFastScroll();
} }
scrollActive_ = true; scrollActive_ = true;
scrollDirectionForward_=false;
break; break;
case ScrollDirectionIdle: case ScrollDirectionIdle:
default: default:

View File

@ -936,7 +936,11 @@ AnimationEvents *PageBuilder::createTweenInstance(xml_node<> *componentXml)
buildTweenSet(tweens, componentXml, "onIdle", "idle"); buildTweenSet(tweens, componentXml, "onIdle", "idle");
buildTweenSet(tweens, componentXml, "onMenuIdle", "menuIdle"); buildTweenSet(tweens, componentXml, "onMenuIdle", "menuIdle");
buildTweenSet(tweens, componentXml, "onMenuScroll", "menuScroll"); buildTweenSet(tweens, componentXml, "onMenuScroll", "menuScroll");
buildTweenSet(tweens, componentXml, "onMenuScrollPrev", "menuScrollPrev");
buildTweenSet(tweens, componentXml, "onMenuScrollNext", "menuScrollNext");
buildTweenSet(tweens, componentXml, "onMenuFastScroll", "menuFastScroll"); buildTweenSet(tweens, componentXml, "onMenuFastScroll", "menuFastScroll");
buildTweenSet(tweens, componentXml, "onMenuFastScrollPrev", "menuFastScrollPrev");
buildTweenSet(tweens, componentXml, "onMenuFastScrollNext", "menuFastScrollNext");
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");