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-popup-impl.cpp;h=babd0eb981d22b9cf1e90c3c57e94309154e8e80;hp=6ea83c0f086d7286b70effd7ba2d83d5297aa2dc;hb=c45b6c9f3254cde5e817f8cfe6d59703f40d28d7;hpb=1f08075655f2a0904c3bd9ac59db4450ac157b90 diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp index 6ea83c0..babd0eb 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include #include #include #include @@ -88,6 +89,9 @@ const char* const OPTION_COPY("optionCopy"); const char* const OPTION_PASTE("optionPaste"); // "Paste" popup option. const char* const OPTION_CLIPBOARD("optionClipboard"); // "Clipboard" popup option. +const std::string IDS_LTR( "IDS_LTR" ); +const std::string RTL_DIRECTION( "RTL" ); + BaseHandle Create() { return Toolkit::TextSelectionPopup::New( NULL ); @@ -802,6 +806,19 @@ std::string TextSelectionPopup::GetPressedImage() const self.Add( mToolbar ); } + // Whether to mirror the list of buttons (for right to left languages) + bool mirror = false; + char* idsLtr = GET_LOCALE_TEXT( IDS_LTR.c_str() ); + if( NULL != idsLtr ) + { + mirror = ( 0 == strcmp( idsLtr, RTL_DIRECTION.c_str() ) ); + + if( mirror ) + { + std::reverse( mOrderListOfButtons.begin(), mOrderListOfButtons.end() ); + } + } + // Iterate list of buttons and add active ones to Toolbar std::size_t numberOfOptionsRequired = GetNumberOfEnabledOptions(); std::size_t numberOfOptionsAdded = 0u; @@ -814,6 +831,11 @@ std::string TextSelectionPopup::GetPressedImage() const AddOption( button, ( numberOfOptionsAdded < numberOfOptionsRequired ) , showIcons, showCaptions ); } } + + if( mirror ) + { + mToolbar.ScrollTo( Vector2( mPopupMaxSize.x, 0.f ) ); + } } void TextSelectionPopup::CreateBackgroundBorder( Property::Map& propertyMap )