Added a custom style to the popup example 90/99690/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 23 Nov 2016 16:27:27 +0000 (16:27 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 24 Nov 2016 10:54:56 +0000 (10:54 +0000)
Change-Id: I60fde090b81f314c68064081effff331c3216128

examples/popup/popup-example.cpp
resources/images/popup-tail-down.png [new file with mode: 0644]
resources/images/popup-tail-left.png [new file with mode: 0644]
resources/images/popup-tail-right.png [new file with mode: 0644]
resources/images/popup-tail-up.png [new file with mode: 0644]
resources/images/popup.9.png [new file with mode: 0644]
resources/style/demo-theme.json.in
resources/style/mobile/demo-theme.json.in

index b79bccc..1068656 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -55,6 +55,7 @@ const char* const POPUP_BUTTON_TITLE_CONTENT_TEXT_ID = "POPUP_BUTTON_TITLE_CONTE
 const char* const POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID = "POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS";
 const char* const POPUP_BUTTON_FIXED_SIZE_ID = "POPUP_BUTTON_FIXED_SIZE_ID";
 const char* const POPUP_BUTTON_COMPLEX_ID = "POPUP_BUTTON_COMPLEX";
+const char* const POPUP_BUTTON_CUSTOM_STYLE = "POPUP_BUTTON_CUSTOM_STYLE";
 
 // Names to give Popup PushButton controls.
 const char* const POPUP_CONTROL_OK_NAME = "controlOk";
@@ -78,11 +79,13 @@ const ButtonItem POPUP_BUTTON_ITEMS[] = {
     { POPUP_BUTTON_CONTENT_TEXT_ID,                "Content Text" },
     { POPUP_BUTTON_CONTENT_IMAGE_ID,               "Content Image" },
     { POPUP_BUTTON_TITLE_CONTENT_TEXT_ID,          "Title + Content" },
-    { POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID, "Title + Large Content + Buttons" }
+    { POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID, "Title + Large Content + Buttons" },
+    { POPUP_BUTTON_CUSTOM_STYLE,                   "Custom Styled Popup" }
 };
 
 const int POPUP_BUTTON_ITEMS_COUNT = sizeof( POPUP_BUTTON_ITEMS ) / sizeof( POPUP_BUTTON_ITEMS[0] );
 
+const char * const CUSTOM_POPUP_STYLE_NAME = "CustomPopupStyle"; ///< Custom popup style name
 }  // anonymous namespace
 
 
@@ -651,6 +654,21 @@ public:
 
       SetupPopup( mPopup, button );
     }
+    else if( button.GetName() == POPUP_BUTTON_CUSTOM_STYLE )
+    {
+      mPopup = CreateConfirmationPopup( 2 );
+
+      Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Styled Popup" );
+      titleActor.SetName( "titleActor" );
+      titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::RED );
+      titleActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
+      titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+      mPopup.SetTitle( titleActor );
+
+      SetupPopup( mPopup, button );
+
+      mPopup.SetStyleName( CUSTOM_POPUP_STYLE_NAME );
+    }
 
     return true;
   }
diff --git a/resources/images/popup-tail-down.png b/resources/images/popup-tail-down.png
new file mode 100644 (file)
index 0000000..2d60fce
Binary files /dev/null and b/resources/images/popup-tail-down.png differ
diff --git a/resources/images/popup-tail-left.png b/resources/images/popup-tail-left.png
new file mode 100644 (file)
index 0000000..12dfd99
Binary files /dev/null and b/resources/images/popup-tail-left.png differ
diff --git a/resources/images/popup-tail-right.png b/resources/images/popup-tail-right.png
new file mode 100644 (file)
index 0000000..26aca93
Binary files /dev/null and b/resources/images/popup-tail-right.png differ
diff --git a/resources/images/popup-tail-up.png b/resources/images/popup-tail-up.png
new file mode 100644 (file)
index 0000000..b600b6b
Binary files /dev/null and b/resources/images/popup-tail-up.png differ
diff --git a/resources/images/popup.9.png b/resources/images/popup.9.png
new file mode 100644 (file)
index 0000000..3f6875f
Binary files /dev/null and b/resources/images/popup.9.png differ
index f9c0d99..95b562a 100644 (file)
       "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
     },
 
+    "CustomPopupStyle":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
+      "popupBackgroundBorder":[0,4,4,0],
+      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
+      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
+      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
+      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
+    },
+
     "TextLabelRosemary":
     {
       "fontFamily":"Rosemary"
index f42198e..644814f 100644 (file)
 {
   "styles":
   {
+    "CustomPopupStyle":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
+      "popupBackgroundBorder":[0,4,4,0],
+      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
+      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
+      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
+      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
+    },
     "TextLabelRosemary":
     {
       "fontFamily":"Rosemary"