Text Selection Popup to use Style sheet for Properties 49/43949/5
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 15 Jul 2015 12:55:39 +0000 (13:55 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 16 Jul 2015 09:14:45 +0000 (10:14 +0100)
Change-Id: I983afd9e02d90e3b325fc1c9876d52fd50aa557a
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h
dali-toolkit/images/selection-popup-bg.9.png [moved from dali-toolkit/images/selection-popup-bg#.png with 100% similarity]
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/styles/dali-toolkit-default-theme.json
dali-toolkit/styles/mobile/dali-toolkit-default-theme.json

index ec3ad65..4b9f548 100644 (file)
@@ -68,6 +68,11 @@ void TextSelectionPopup::RaiseAbove( Layer target )
   GetImpl(*this).RaiseAbove( target );
 }
 
   GetImpl(*this).RaiseAbove( target );
 }
 
+void TextSelectionPopup::ShowPopup()
+{
+  GetImpl(*this).ShowPopup();
+}
+
 TextSelectionPopup::TextSelectionPopup( Internal::TextSelectionPopup& implementation )
 : Control(implementation)
 {
 TextSelectionPopup::TextSelectionPopup( Internal::TextSelectionPopup& implementation )
 : Control(implementation)
 {
index 8608891..67a7966 100644 (file)
@@ -86,6 +86,9 @@ public:
       POPUP_PASTE_BUTTON_ICON_IMAGE,            ///< name "popup-paste-button-image",      The image to use as the popup paste icon,       type STRING
       POPUP_SELECT_BUTTON_ICON_IMAGE,           ///< name "popup-select-button-image",     The image to use as the popup select icon,      type STRING
       POPUP_SELECT_ALL_BUTTON_ICON_IMAGE,       ///< name "popup-select-all-button-image", The image to use as the popup select all icon,  type STRING
       POPUP_PASTE_BUTTON_ICON_IMAGE,            ///< name "popup-paste-button-image",      The image to use as the popup paste icon,       type STRING
       POPUP_SELECT_BUTTON_ICON_IMAGE,           ///< name "popup-select-button-image",     The image to use as the popup select icon,      type STRING
       POPUP_SELECT_ALL_BUTTON_ICON_IMAGE,       ///< name "popup-select-all-button-image", The image to use as the popup select all icon,  type STRING
+      DIVIDER_COLOR,                            ///< name "popup-divider-color", VECTOR4,  The color of the divider between options,       type VECTOR4
+      ICON_COLOR,                               ///< name "popup-icon-color", VECTOR4,     The color of the icons (if supplied),           type VECTOR4
+      PRESSED_COLOR                             ///< name "popup-pressed-color", VECTOR4,  The color of the option when pressed,           type VECTOR4
     };
   };
 
     };
   };
 
@@ -143,6 +146,11 @@ public:
    */
   void RaiseAbove( Layer target );
 
    */
   void RaiseAbove( Layer target );
 
+  /**
+   * @brief Show the Popup
+   */
+  void ShowPopup();
+
 public: // Not intended for application developers
 
   /**
 public: // Not intended for application developers
 
   /**
index 558d831..8fda39b 100644 (file)
@@ -115,7 +115,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         STRING,    SELECTION_HANDLE_IMAGE_RIGHT         )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  STRING,    SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         STRING,    SELECTION_HANDLE_IMAGE_RIGHT         )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  STRING,    SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            STRING,    SELECTION_HIGHLIGHT_COLOR            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            VECTOR4,   SELECTION_HIGHLIGHT_COLOR            )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings",                MAP,       INPUT_METHOD_SETTINGS                )
 
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings",                MAP,       INPUT_METHOD_SETTINGS                )
 
index 1b61bbb..3ff907b 100644 (file)
@@ -49,20 +49,6 @@ namespace
 
 const std::string TEXT_SELECTION_POPUP_LABEL = "textselectionpopuplabel";
 
 
 const std::string TEXT_SELECTION_POPUP_LABEL = "textselectionpopuplabel";
 
-const Dali::Vector4 DEFAULT_POPUP_DIVIDER_COLOR( Dali::Vector4( 0.23f, 0.72f, 0.8f, 0.11f ) );
-const Dali::Vector4 DEFAULT_OPTION_ICON( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Dali::Vector4 DEFAULT_OPTION_PRESSED_COLOR( Dali::Vector4( 0.24f, 0.72f, 0.8f, 0.11f ) );
-
-const std::string DEFAULT_POPUP_BACKGROUND_IMAGE( DALI_IMAGE_DIR "selection-popup-bg#.png" );
-const std::string OPTION_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" );
-const std::string OPTION_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" );
-const std::string OPTION_ICON_CUT( DALI_IMAGE_DIR "copy_paste_icon_cut.png" );
-const std::string OPTION_ICON_PASTE( DALI_IMAGE_DIR "copy_paste_icon_paste.png" );
-const std::string OPTION_ICON_SELECT( DALI_IMAGE_DIR "copy_paste_icon_select.png" );
-const std::string OPTION_ICON_SELECT_ALL( DALI_IMAGE_DIR "copy_paste_icon_select_all.png" );
-
-const float OPTION_MARGIN_WIDTH( 10.f );          ///< The margin between the right or lefts edge and the text or icon.
-
 #ifdef DGETTEXT_ENABLED
 
 #define POPUP_CUT_STRING GET_LOCALE_TEXT("IDS_COM_BODY_CUT")
 #ifdef DGETTEXT_ENABLED
 
 #define POPUP_CUT_STRING GET_LOCALE_TEXT("IDS_COM_BODY_CUT")
@@ -110,6 +96,9 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-copy-button-imag
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-paste-button-image", STRING, POPUP_PASTE_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-select-button-image", STRING, POPUP_SELECT_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-select-all-button-image", STRING, POPUP_SELECT_ALL_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-paste-button-image", STRING, POPUP_PASTE_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-select-button-image", STRING, POPUP_SELECT_BUTTON_ICON_IMAGE )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-select-all-button-image", STRING, POPUP_SELECT_ALL_BUTTON_ICON_IMAGE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-divider-color", VECTOR4, DIVIDER_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-icon-color", VECTOR4, ICON_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextSelectionPopup, "popup-pressed-color", VECTOR4, PRESSED_COLOR )
 
 DALI_TYPE_REGISTRATION_END()
 
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -148,11 +137,6 @@ void TextSelectionPopup::SetProperty( BaseObject* object, Property::Index index,
        impl.SetDimensionToCustomise( POPUP_MAXIMUM_SIZE, value.Get< Vector2 >() );
        break;
       }
        impl.SetDimensionToCustomise( POPUP_MAXIMUM_SIZE, value.Get< Vector2 >() );
        break;
       }
-      case Toolkit::TextSelectionPopup::Property::POPUP_MIN_SIZE:
-      {
-        impl.SetDimensionToCustomise( POPUP_MINIMUM_SIZE, value.Get< Vector2 >() );
-        break;
-      }
       case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
       {
         impl.SetDimensionToCustomise( OPTION_MAXIMUM_SIZE, value.Get< Vector2 >() );
       case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
       {
         impl.SetDimensionToCustomise( OPTION_MAXIMUM_SIZE, value.Get< Vector2 >() );
@@ -204,6 +188,21 @@ void TextSelectionPopup::SetProperty( BaseObject* object, Property::Index index,
         impl.SetButtonImage( Toolkit::TextSelectionPopup::SELECT_ALL, image );
         break;
       }
         impl.SetButtonImage( Toolkit::TextSelectionPopup::SELECT_ALL, image );
         break;
       }
+      case Toolkit::TextSelectionPopup::Property::DIVIDER_COLOR:
+      {
+        impl.mDividerColor = value.Get< Vector4 >();
+        break;
+      }
+      case Toolkit::TextSelectionPopup::Property::ICON_COLOR:
+      {
+        impl.mIconColor = value.Get< Vector4 >();
+        break;
+      }
+      case Toolkit::TextSelectionPopup::Property::PRESSED_COLOR:
+      {
+        impl.mPressedColor = value.Get< Vector4 >();
+        break;
+      }
     } // switch
   } // TextSelectionPopup
 }
     } // switch
   } // TextSelectionPopup
 }
@@ -307,6 +306,11 @@ void TextSelectionPopup::RaiseAbove( Layer target )
   }
 }
 
   }
 }
 
+void TextSelectionPopup::ShowPopup()
+{
+  AddPopupOptionsToToolbar( mShowIcons, mShowCaptions );
+}
+
 void TextSelectionPopup::OnInitialize()
 {
   CreatePopup();
 void TextSelectionPopup::OnInitialize()
 {
   CreatePopup();
@@ -386,26 +390,16 @@ void TextSelectionPopup::SetDimensionToCustomise( const PopupCustomisations& set
   {
     case POPUP_MAXIMUM_SIZE :
     {
   {
     case POPUP_MAXIMUM_SIZE :
     {
-      Actor self = Self();
-      mMaxSize = dimension;
       if ( mToolbar )
       {
       if ( mToolbar )
       {
-        mToolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, mMaxSize );
+        mToolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, dimension );
       }
       break;
     }
       }
       break;
     }
-    case POPUP_MINIMUM_SIZE :
-    {
-      Actor self = Self();
-      mMinSize = dimension;
-      // Option can not be smaller than this if only one.
-      break;
-    }
     case OPTION_MAXIMUM_SIZE :
     {
       mOptionMaxSize = dimension;
       // Option max size not currently currently supported
     case OPTION_MAXIMUM_SIZE :
     {
       mOptionMaxSize = dimension;
       // Option max size not currently currently supported
-
       break;
     }
     case OPTION_MINIMUM_SIZE :
       break;
     }
     case OPTION_MINIMUM_SIZE :
@@ -432,11 +426,7 @@ Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& set
   {
     case POPUP_MAXIMUM_SIZE :
     {
   {
     case POPUP_MAXIMUM_SIZE :
     {
-      return mMaxSize;
-    }
-    case POPUP_MINIMUM_SIZE :
-    {
-      return mMinSize;
+      return mToolbar.GetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE ).Get< Vector2 >();
     }
     case OPTION_MAXIMUM_SIZE :
     {
     }
     case OPTION_MAXIMUM_SIZE :
     {
@@ -546,38 +536,11 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
    mOrderListOfButtons.reserve( 8u );
 
    // Create button for each possible option using Option priority
    mOrderListOfButtons.reserve( 8u );
 
    // Create button for each possible option using Option priority
-   if ( !mCutIconImage )
-   {
-     mCutIconImage = ResourceImage::New( OPTION_ICON_CUT );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CUT, mCutOptionPriority, OPTION_CUT, POPUP_CUT_STRING , mCutIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CUT)  ) );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CUT, mCutOptionPriority, OPTION_CUT, POPUP_CUT_STRING , mCutIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CUT)  ) );
-
-   if ( !mCopyIconImage )
-   {
-     mCopyIconImage = ResourceImage::New( OPTION_ICON_COPY );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::COPY, mCopyOptionPriority, OPTION_COPY, POPUP_COPY_STRING, mCopyIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::COPY)  ) );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::COPY, mCopyOptionPriority, OPTION_COPY, POPUP_COPY_STRING, mCopyIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::COPY)  ) );
-
-   if ( !mPasteIconImage )
-   {
-     mPasteIconImage = ResourceImage::New( OPTION_ICON_PASTE );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::PASTE, mPasteOptionPriority, OPTION_PASTE, POPUP_PASTE_STRING, mPasteIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::PASTE)  ) );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::PASTE, mPasteOptionPriority, OPTION_PASTE, POPUP_PASTE_STRING, mPasteIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::PASTE)  ) );
-
-   if ( !mSelectIconImage )
-   mSelectIconImage = ResourceImage::New( OPTION_ICON_SELECT );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT, mSelectOptionPriority, OPTION_SELECT_WORD, POPUP_SELECT_STRING, mSelectIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT)  ) );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT, mSelectOptionPriority, OPTION_SELECT_WORD, POPUP_SELECT_STRING, mSelectIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT)  ) );
-
-   if ( !mSelectAllIconImage )
-   {
-    mSelectAllIconImage = ResourceImage::New( OPTION_ICON_SELECT_ALL );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT_ALL, mSelectAllOptionPriority, OPTION_SELECT_ALL, POPUP_SELECT_ALL_STRING, mSelectAllIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT_ALL)  ) );
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::SELECT_ALL, mSelectAllOptionPriority, OPTION_SELECT_ALL, POPUP_SELECT_ALL_STRING, mSelectAllIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::SELECT_ALL)  ) );
-
-   if ( !mClipboardIconImage )
-   {
-     mClipboardIconImage = ResourceImage::New( OPTION_ICON_CLIPBOARD );
-   }
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CLIPBOARD, mClipboardOptionPriority, OPTION_CLIPBOARD, POPUP_CLIPBOARD_STRING, mClipboardIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CLIPBOARD)  ) );
 
    // Sort the buttons according their priorities.
    mOrderListOfButtons.push_back( ButtonRequirement( Toolkit::TextSelectionPopup::CLIPBOARD, mClipboardOptionPriority, OPTION_CLIPBOARD, POPUP_CLIPBOARD_STRING, mClipboardIconImage, ( mEnabledButtons & Toolkit::TextSelectionPopup::CLIPBOARD)  ) );
 
    // Sort the buttons according their priorities.
@@ -634,7 +597,7 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
 
    int depth = Self().GetHierarchyDepth();
    // 3. Create the icons
 
    int depth = Self().GetHierarchyDepth();
    // 3. Create the icons
-   if ( showIcons )
+   if ( showIcons && iconImage )
    {
      ImageActor pressedIcon = ImageActor::New(  iconImage );
      ImageActor icon = ImageActor::New(  iconImage );
    {
      ImageActor pressedIcon = ImageActor::New(  iconImage );
      ImageActor icon = ImageActor::New(  iconImage );
@@ -765,31 +728,26 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
  void TextSelectionPopup::CreatePopup()
  {
    Actor self = Self();
  void TextSelectionPopup::CreatePopup()
  {
    Actor self = Self();
-   CreateOrderedListOfPopupOptions();  //todo Currently causes all options to be shown
+   CreateOrderedListOfPopupOptions();
    self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
    self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
-   SetBackgroundImage( NinePatchImage::New( DEFAULT_POPUP_BACKGROUND_IMAGE ) );
 
    if( !mToolbar )
    {
      mToolbar = Toolkit::TextSelectionToolbar::New();
      mToolbar.SetParentOrigin( ParentOrigin::CENTER );
 
    if( !mToolbar )
    {
      mToolbar = Toolkit::TextSelectionToolbar::New();
      mToolbar.SetParentOrigin( ParentOrigin::CENTER );
-     mToolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, mMaxSize );
      self.Add( mToolbar );
      self.Add( mToolbar );
-     AddPopupOptionsToToolbar( mShowIcons, mShowCaptions );
    }
  }
 
 TextSelectionPopup::TextSelectionPopup( TextSelectionPopupCallbackInterface* callbackInterface )
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mToolbar(),
    }
  }
 
 TextSelectionPopup::TextSelectionPopup( TextSelectionPopupCallbackInterface* callbackInterface )
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mToolbar(),
-  mMaxSize(),
-  mMinSize(),
-  mOptionDividerSize( Size( 2.0f, 0.0f) ),
+  mOptionDividerSize(),
   mEnabledButtons( Toolkit::TextSelectionPopup::NONE ),
   mCallbackInterface( callbackInterface ),
   mEnabledButtons( Toolkit::TextSelectionPopup::NONE ),
   mCallbackInterface( callbackInterface ),
-  mDividerColor( DEFAULT_POPUP_DIVIDER_COLOR ),
-  mIconColor( DEFAULT_OPTION_ICON ),
-  mPressedColor( DEFAULT_OPTION_PRESSED_COLOR ),
+  mDividerColor( Color::WHITE ),
+  mIconColor(  Color::WHITE ),
+  mPressedColor(  Color::WHITE ),
   mSelectOptionPriority( 1 ),
   mSelectAllOptionPriority ( 2 ),
   mCutOptionPriority ( 4 ),
   mSelectOptionPriority( 1 ),
   mSelectAllOptionPriority ( 2 ),
   mCutOptionPriority ( 4 ),
index 3bb8b71..619dc37 100644 (file)
@@ -44,7 +44,6 @@ namespace
 enum PopupCustomisations
 {
   POPUP_MAXIMUM_SIZE,
 enum PopupCustomisations
 {
   POPUP_MAXIMUM_SIZE,
-  POPUP_MINIMUM_SIZE,
   OPTION_MAXIMUM_SIZE,
   OPTION_MINIMUM_SIZE,
   OPTION_DIVIDER_SIZE
   OPTION_MAXIMUM_SIZE,
   OPTION_MINIMUM_SIZE,
   OPTION_DIVIDER_SIZE
@@ -129,6 +128,11 @@ public:
    */
   void RaiseAbove( Layer target );
 
    */
   void RaiseAbove( Layer target );
 
+  /**
+   * @copydoc Toolkit::TextSelectionPopup::ShowPopup()
+   */
+  void ShowPopup();
+
 private: // From Control
 
   /**
 private: // From Control
 
   /**
@@ -257,9 +261,6 @@ private: // Data
   Image mSelectIconImage;
   Image mSelectAllIconImage;
 
   Image mSelectIconImage;
   Image mSelectAllIconImage;
 
-  Size mMaxSize;                       // Maximum size of the Popup
-  Size mMinSize;                       // Minimum size of the Popup
-
   Size mOptionMaxSize;                 // Maximum size of an Option button
   Size mOptionMinSize;                 // Minimum size of an Option button
   Size mOptionDividerSize;             // Size of divider line
   Size mOptionMaxSize;                 // Maximum size of an Option button
   Size mOptionMinSize;                 // Minimum size of an Option button
   Size mOptionDividerSize;             // Size of divider line
index 756c44d..78d8f5f 100644 (file)
@@ -154,6 +154,11 @@ void TextSelectionToolbar::OnStageConnection( int depth )
 void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize )
 {
   mMaxSize = maxSize;
 void TextSelectionToolbar::SetPopupMaxSize( const Size& maxSize )
 {
   mMaxSize = maxSize;
+  if (mScrollView && mStencilLayer )
+  {
+    mScrollView.SetMaximumSize( mMaxSize );
+    mStencilLayer.SetMaximumSize( mMaxSize );
+  }
 }
 
 const Dali::Vector2& TextSelectionToolbar::GetPopupMaxSize() const
 }
 
 const Dali::Vector2& TextSelectionToolbar::GetPopupMaxSize() const
@@ -166,7 +171,6 @@ void TextSelectionToolbar::SetUpScrollView( Toolkit::ScrollView& scrollView )
   scrollView.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   scrollView.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
   scrollView.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   scrollView.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-  scrollView.SetMaximumSize( mMaxSize );
 
   scrollView.SetScrollingDirection( PanGestureDetector::DIRECTION_HORIZONTAL, Degree( 40.0f ) );
   scrollView.SetAxisAutoLock( true );
 
   scrollView.SetScrollingDirection( PanGestureDetector::DIRECTION_HORIZONTAL, Degree( 40.0f ) );
   scrollView.SetAxisAutoLock( true );
@@ -189,7 +193,6 @@ void TextSelectionToolbar::SetUp()
   mStencilLayer = Layer::New();
   mStencilLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   mStencilLayer.SetParentOrigin( ParentOrigin::CENTER );
   mStencilLayer = Layer::New();
   mStencilLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
   mStencilLayer.SetParentOrigin( ParentOrigin::CENTER );
-  mStencilLayer.SetMaximumSize( mMaxSize );
 
   ImageActor stencil = CreateSolidColorActor( Color::RED );
   stencil.SetDrawMode( DrawMode::STENCIL );
 
   ImageActor stencil = CreateSolidColorActor( Color::RED );
   stencil.SetDrawMode( DrawMode::STENCIL );
@@ -253,7 +256,7 @@ void TextSelectionToolbar::RaiseAbove( Layer target )
 
 TextSelectionToolbar::TextSelectionToolbar()
 : Control( ControlBehaviour( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ) ),
 
 TextSelectionToolbar::TextSelectionToolbar()
 : Control( ControlBehaviour( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ) ),
-  mMaxSize ( DEFAULT_MAX_SIZE ),
+  mMaxSize (),
   mIndexInTable( 0 ),
   mDividerIndexes()
 {
   mIndexInTable( 0 ),
   mDividerIndexes()
 {
index 49fe080..494805b 100644 (file)
@@ -1527,6 +1527,7 @@ void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButt
    if( mImpl->mActiveLayer )
    {
      mImpl->mActiveLayer.Add( mImpl->mCopyPastePopup.actor );
    if( mImpl->mActiveLayer )
    {
      mImpl->mActiveLayer.Add( mImpl->mCopyPastePopup.actor );
+     mImpl->mCopyPastePopup.actor.ShowPopup();
    }
 }
 
    }
 }
 
index c47661f..014efd4 100644 (file)
@@ -44,7 +44,13 @@ distributing this software or its derivatives.
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
-      "popup-min-size":[100,65]
+      "option-divider-size":[2,0],
+      "popup-divider-color":[0.23,0.72,0.8,0.11],
+      "popup-icon-color":[1.0,1.0,1.0,1.0],
+      "popup-pressed-color":[0.24,0.72,0.8,0.11],
+      "background-image": {
+        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        }
     },
     "textfield":
     {
     },
     "textfield":
     {
index b4536b8..8eeec51 100644 (file)
@@ -58,6 +58,7 @@ distributing this software or its derivatives.
       "point-size":25
     },
 
       "point-size":25
     },
 
+
     "textfield":
     {
       "font-family":"SamsungSans",
     "textfield":
     {
       "font-family":"SamsungSans",
@@ -97,7 +98,13 @@ distributing this software or its derivatives.
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
-      "popup-min-size":[100,65]
+      "option-divider-size":[2,0],
+      "popup-divider-color":[0.23,0.72,0.8,0.11],
+      "popup-icon-color":[1.0,1.0,1.0,1.0],
+      "popup-pressed-color":[0.24,0.72,0.8,0.11],
+      "background-image": {
+        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        }
     },
     "scrollview":
     {
     },
     "scrollview":
     {