TextSelection Popup Styling Image update and json 99/42999/13
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 6 Jul 2015 16:00:00 +0000 (17:00 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 8 Jul 2015 16:55:03 +0000 (17:55 +0100)
Change-Id: I75fa29003e4f77aa7b81294ea6205fb5ad7ad7ef
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
dali-toolkit/images/selection-popup-bg#.png
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/styles/dali-toolkit-default-theme.json
dali-toolkit/styles/mobile/dali-toolkit-default-theme.json

index 3eac19f..bd91191 100755 (executable)
Binary files a/dali-toolkit/images/selection-popup-bg#.png and b/dali-toolkit/images/selection-popup-bg#.png differ
index 199c8ef..ad9871b 100644 (file)
@@ -47,10 +47,14 @@ namespace
 // todo Move this to adaptor??
 #define GET_LOCALE_TEXT(string) dgettext("elementary", string)
 
 // todo Move this to adaptor??
 #define GET_LOCALE_TEXT(string) dgettext("elementary", string)
 
+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 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 float DEFAULT_CAPTION_POINT_SIZE = 8.0f; // todo This should be from the style sheet not fixed.
+
 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 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" );
@@ -124,7 +128,6 @@ Dali::Toolkit::TextSelectionPopup TextSelectionPopup::New( Toolkit::TextSelectio
   Dali::Toolkit::TextSelectionPopup handle( *impl );
 
   impl->mEnabledButtons = buttonsToEnable;
   Dali::Toolkit::TextSelectionPopup handle( *impl );
 
   impl->mEnabledButtons = buttonsToEnable;
-
   // Second-phase init of the implementation
   // This can only be done after the CustomActor connection has been made...
   impl->Initialize();
   // Second-phase init of the implementation
   // This can only be done after the CustomActor connection has been made...
   impl->Initialize();
@@ -610,11 +613,15 @@ Dali::Image TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::But
    if ( showCaption )
    {
      Toolkit::TextLabel captionTextLabel = Toolkit::TextLabel::New();
    if ( showCaption )
    {
      Toolkit::TextLabel captionTextLabel = Toolkit::TextLabel::New();
+     captionTextLabel.SetStyleName( TEXT_SELECTION_POPUP_LABEL );
      captionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
      captionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
+     captionTextLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, DEFAULT_CAPTION_POINT_SIZE );
      captionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
      Toolkit::TextLabel pressedCaptionTextLabel = Toolkit::TextLabel::New();
      captionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
      Toolkit::TextLabel pressedCaptionTextLabel = Toolkit::TextLabel::New();
+     pressedCaptionTextLabel.SetStyleName( TEXT_SELECTION_POPUP_LABEL );
      pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
      pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
+     pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, DEFAULT_CAPTION_POINT_SIZE );
      pressedCaptionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
      Padding padding;
      pressedCaptionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
      Padding padding;
index bc12cec..c47661f 100644 (file)
@@ -37,11 +37,14 @@ distributing this software or its derivatives.
       "font-style":"Regular",
       "point-size":18
     },
       "font-style":"Regular",
       "point-size":18
     },
+    "textselectionpopuplabel":
+    {
+      "point-size":18
+    },
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
-      "popup-min-size":[100,65],
-      "background-color":[0.0,0.0,0.0,1.0]
+      "popup-min-size":[100,65]
     },
     "textfield":
     {
     },
     "textfield":
     {
index a8d4c04..b4536b8 100644 (file)
@@ -90,11 +90,14 @@ distributing this software or its derivatives.
     {
       "point-size":10
     },
     {
       "point-size":10
     },
+    "textselectionpopuplabel":
+    {
+      "point-size":8
+    },
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
     "textselectionpopup":
     {
       "popup-max-size":[400,100],
-      "popup-min-size":[100,65],
-      "background-color":[0.0,0.0,0.0,1.0]
+      "popup-min-size":[100,65]
     },
     "scrollview":
     {
     },
     "scrollview":
     {