X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fnavigation-view%2Fnavigation-view-impl.cpp;h=47906cd4a30df3975413dd7803eb1bdc4fad779e;hp=5ddf48c6fbf3b530a5c1e75df259328107807335;hb=f2039d47f9bed8104575da80a2ecf0bb6e37ff8d;hpb=db152116b8c7de79b206d7d361c9d3875d05d0ac diff --git a/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp b/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp index 5ddf48c..47906cd 100644 --- a/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp +++ b/dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,31 +22,28 @@ #include // INTERNAL INCLUDES +#include namespace Dali { - namespace Toolkit { - namespace Internal { - namespace // to register type { - BaseHandle Create() { return Toolkit::NavigationView::New(); } -DALI_TYPE_REGISTRATION_BEGIN( Toolkit::NavigationView, Toolkit::Control, Create ) +DALI_TYPE_REGISTRATION_BEGIN(Toolkit::NavigationView, Toolkit::Control, Create) DALI_TYPE_REGISTRATION_END() } // namespace NavigationView::NavigationView() -: Control(ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ) +: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)) { } @@ -59,10 +56,10 @@ NavigationView::~NavigationView() Toolkit::NavigationView NavigationView::New() { // Create the implementation, temporarily owned by this handle on stack - IntrusivePtr< NavigationView > internalNavigationView = new NavigationView(); + IntrusivePtr internalNavigationView = new NavigationView(); // Pass ownership to CustomActor handle - Toolkit::NavigationView navigationView( *internalNavigationView ); + Toolkit::NavigationView navigationView(*internalNavigationView); // Second-phase init of the implementation // This can only be done after the CustomActor connection has been made... @@ -71,25 +68,33 @@ Toolkit::NavigationView NavigationView::New() return navigationView; } -void NavigationView::OnStageConnection( int depth ) +void NavigationView::OnInitialize() { - Self().SetSensitive(true); + DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) { + return std::unique_ptr( + new Control::Impl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER)); + }); +} + +void NavigationView::OnSceneConnection(int depth) +{ + Self().SetProperty(Actor::Property::SENSITIVE, true); - Control::OnStageConnection( depth ); + Control::OnSceneConnection(depth); } -void NavigationView::Push( Actor& actor ) +void NavigationView::Push(Actor& actor) { // check the uninitialized item // check the duplicated push for the top item - if(!actor ) + if(!actor) { return; } - if( mContentStack.size() > 0 ) + if(mContentStack.size() > 0) { - Self().Remove( mContentStack.back() ); + Self().Remove(mContentStack.back()); } //push the new item into the stack and show it @@ -101,7 +106,7 @@ Actor NavigationView::Pop() { // cannot pop out the bottom-most item Actor poppedItem; - if( mContentStack.size() > 1 ) + if(mContentStack.size() > 1) { // pop out the top item of the stack and show the new item right under the old one. Self().Remove(mContentStack.back());