X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-selection-toolbar-impl.cpp;h=3736f674e2170f8c24d1520352423c38b2de85ef;hp=66f747e167cac3bdc4cb9066011d458efd6fce7b;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=cbda2de83c5025276c35d69044934ab1258b4998 diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp index 66f747e..3736f67 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include namespace Dali { @@ -185,10 +185,10 @@ void TextSelectionToolbar::OnRelayout( const Vector2& size, RelayoutContainer& c void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize ) { mMaxSize = maxSize; - if (mScrollView && mToolbarLayer ) + if( mScrollView && mToolbarActor ) { mScrollView.SetProperty( Actor::Property::MAXIMUM_SIZE, mMaxSize ); - mToolbarLayer.SetProperty( Actor::Property::MAXIMUM_SIZE, mMaxSize ); + mToolbarActor.SetProperty( Actor::Property::MAXIMUM_SIZE, mMaxSize ); } } @@ -225,11 +225,11 @@ void TextSelectionToolbar::SetUp() self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); - // Create Layer to house the toolbar. - mToolbarLayer = Layer::New(); - mToolbarLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); - mToolbarLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - mToolbarLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + // Create Actor to house the toolbar. + mToolbarActor = Actor::New(); + mToolbarActor.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS ); + mToolbarActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + mToolbarActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); if( !mScrollView ) { @@ -244,9 +244,9 @@ void TextSelectionToolbar::SetUp() mTableOfButtons.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); mScrollView.Add( mTableOfButtons ); - mToolbarLayer.Add( mScrollView ); + mToolbarActor.Add( mScrollView ); - self.Add( mToolbarLayer ); + self.Add( mToolbarActor ); } void TextSelectionToolbar::SetUpScrollBar( bool enable ) @@ -260,7 +260,7 @@ void TextSelectionToolbar::SetUpScrollBar( bool enable ) indicator.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); indicator.SetStyleName( "TextSelectionScrollIndicator" ); - mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::Horizontal ); + mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::HORIZONTAL ); mScrollBar.SetProperty( Dali::Actor::Property::NAME, "Text popup scroll bar" ); mScrollBar.SetStyleName( "TextSelectionScrollBar" ); mScrollBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); @@ -317,9 +317,9 @@ void TextSelectionToolbar::ResizeDividers( Size& size ) RelayoutRequest(); } -void TextSelectionToolbar::RaiseAbove( Layer target ) +void TextSelectionToolbar::RaiseAbove( Actor target ) { - mToolbarLayer.RaiseAbove( target ); + mToolbarActor.RaiseAbove( target ); } void TextSelectionToolbar::SetScrollBarPadding( const Vector2& padding ) @@ -385,6 +385,12 @@ TextSelectionToolbar::TextSelectionToolbar() mDividerIndexes(), mFirstScrollEnd( false ) { + DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) + { + return std::unique_ptr< Dali::Accessibility::Accessible >( + new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::TOOL_BAR, true ) ); + } + ); } TextSelectionToolbar::~TextSelectionToolbar()