#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
#include <dali-toolkit/public-api/visuals/text-visual-properties.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/internal/helpers/color-conversion.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
namespace Dali
{
mButtonsChanged = true;
}
-void TextSelectionPopup::RaiseAbove( Layer target )
+void TextSelectionPopup::RaiseAbove( Actor target )
{
if( mToolbar )
{
Actor self = Self();
self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
self.SetProperty( Actor::Property::COLOR_ALPHA, 0.0f );
+
+ DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+ return std::unique_ptr< Dali::Accessibility::Accessible >(
+ new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::DIALOG, true ) );
+ } );
+
+ //Enable highightability
+ self.SetProperty( Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true );
}
void TextSelectionPopup::HideAnimationFinished( Animation& animation )
} // switch
}
-Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise )
+Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise ) const
{
switch( settingToCustomise )
{
} // switch
}
-std::string TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button )
+const std::string& TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const
{
- std::string buttonImageUrl;
switch ( button )
{
- case Toolkit::TextSelectionPopup::CLIPBOARD :
+ case Toolkit::TextSelectionPopup::CLIPBOARD:
{
- buttonImageUrl = mClipboardIconImage;
+ return mClipboardIconImage;
break;
}
- case Toolkit::TextSelectionPopup::CUT :
+ case Toolkit::TextSelectionPopup::CUT:
{
- buttonImageUrl = mCutIconImage;
+ return mCutIconImage;
break;
}
- case Toolkit::TextSelectionPopup::COPY :
+ case Toolkit::TextSelectionPopup::COPY:
{
- buttonImageUrl = mCopyIconImage;
+ return mCopyIconImage;
break;
}
- case Toolkit::TextSelectionPopup::PASTE :
+ case Toolkit::TextSelectionPopup::PASTE:
{
- buttonImageUrl = mPasteIconImage;
+ return mPasteIconImage;
break;
}
- case Toolkit::TextSelectionPopup::SELECT :
+ case Toolkit::TextSelectionPopup::SELECT:
{
- buttonImageUrl = mSelectIconImage;
+ return mSelectIconImage;
break;
}
- case Toolkit::TextSelectionPopup::SELECT_ALL :
+ case Toolkit::TextSelectionPopup::SELECT_ALL:
{
- buttonImageUrl = mSelectAllIconImage;
+ return mSelectAllIconImage;
break;
}
- default :
+ case Toolkit::TextSelectionPopup::NONE:
{
- DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" );
+ break;
}
} // switch
- return buttonImageUrl;
+ DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" );
+ static std::string empty;
+ return empty;
}
void TextSelectionPopup::SetPressedImage( const std::string& filename )
if( showIcons )
{
option.SetProperty( Toolkit::PushButton::Property::ICON_PADDING, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
- option.SetProperty( Toolkit::PushButton::Property::ICON_ALIGNMENT, "TOP" );
+ option.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BOTTOM" );
// TODO: This is temporarily disabled until the text-selection-popup image API is changed to strings.
- //option.SetProperty( Toolkit::PushButton::Property::SELECTED_ICON, button.icon );
- //option.SetProperty( Toolkit::PushButton::Property::UNSELECTED_ICON, button.icon );
+ //option.SetProperty( Toolkit::Button::Property::SELECTED_VISUAL, button.icon );
+ //option.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, button.icon );
}
// 3. Set the normal option image (blank / Transparent).
}
}
- std::size_t TextSelectionPopup::GetNumberOfEnabledOptions()
+ std::size_t TextSelectionPopup::GetNumberOfEnabledOptions() const
{
std::size_t numberOfOptions = 0u;
for( std::vector<ButtonRequirement>::const_iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt ); ++it )