2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
20 using namespace Dali::Toolkit;
23 namespace // unnamed namespace
25 // Popup style default
26 const Vector4 DEFAULT_BACKING_COLOR = Vector4(0.0f, 0.0f, 0.0f, 0.5f);
27 const float DEFAULT_MARGIN = 20.0f; //From Tizen GUI UX
28 const float DEFAULT_BUTTON_SPACING = 20.0f; //From Tizen GUI UX
29 const Vector3 DEFAULT_BUTTON_SIZE(275.0f, 74.0f, 0.0f);
30 const char* DEFAULT_BACKGROUND_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_bg.png";
31 const char* DEFAULT_BUTTON_AREA_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_button_bg.png";
32 const char* DEFAULT_TAIL_UP_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_up.png";
33 const char* DEFAULT_TAIL_DOWN_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_down.png";
34 const char* DEFAULT_TAIL_LEFT_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_left.png";
35 const char* DEFAULT_TAIL_RIGHT_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_right.png";
36 const Vector3 DEFAULT_BOTTOM_SIZE(620.0f,96.0f,0.0f);
37 const Vector2 DEFAULT_BACKGROUND_SIZE(620.0f, 236.0f);
38 const Vector4 DEFAULT_BACKGROUND_STYLE_9_BORDER( 25.0f, 25.0f, 26.0f, 50.0f );
39 const Vector4 DEFAULT_BACKGROUND_OUTER_BORDER( 0.0f, 0.0f, 0.0f, 0.0f );
40 const Vector4 DEFAULT_BUTTON_AREA_9_PATCH_BORDER( 13.0f, 8.0f, 13.0f, 8.0f );
52 ///////////////////////////////////////////////////////////////////////////////
53 // Popup Style (base class)
54 ///////////////////////////////////////////////////////////////////////////////
56 PopupStyle::PopupStyle()
61 backgroundScale9Border(),
62 backgroundOuterBorder(),
63 buttonArea9PatchBorder(),
74 PopupStyle::~PopupStyle()
78 ///////////////////////////////////////////////////////////////////////////////
79 // Popup style: Default
80 ///////////////////////////////////////////////////////////////////////////////
82 PopupStyleDefault::PopupStyleDefault()
84 backingColor = DEFAULT_BACKING_COLOR;
85 backgroundImage = DEFAULT_BACKGROUND_IMAGE_PATH;
86 buttonAreaImage = DEFAULT_BUTTON_AREA_IMAGE_PATH;
87 margin = DEFAULT_MARGIN;
88 buttonSpacing = DEFAULT_BUTTON_SPACING;
89 buttonSize = DEFAULT_BUTTON_SIZE;
90 tailUpImage = DEFAULT_TAIL_UP_IMAGE_PATH;
91 tailDownImage = DEFAULT_TAIL_DOWN_IMAGE_PATH;
92 tailLeftImage = DEFAULT_TAIL_LEFT_IMAGE_PATH;
93 tailRightImage = DEFAULT_TAIL_RIGHT_IMAGE_PATH;
94 backgroundSize = DEFAULT_BACKGROUND_SIZE;
95 backgroundScale9Border = DEFAULT_BACKGROUND_STYLE_9_BORDER;
96 backgroundOuterBorder = DEFAULT_BACKGROUND_OUTER_BORDER;
97 buttonArea9PatchBorder = DEFAULT_BUTTON_AREA_9_PATCH_BORDER;
98 bottomSize = DEFAULT_BOTTOM_SIZE;
101 PopupStyleDefaultPtr PopupStyleDefault::New()
103 return PopupStyleDefaultPtr(new PopupStyleDefault());
106 PopupStyleDefault::~PopupStyleDefault()
110 } // namespace Internal
112 } // namespace Toolkit