From: Agnelo Vaz Date: Fri, 2 Dec 2016 11:51:43 +0000 (+0000) Subject: Adding button-devel.h and deprecation updates X-Git-Tag: dali_1.2.19~11 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=72ea28bfe5df526ce47369c36edf1390641fff5a Adding button-devel.h and deprecation updates Removing new visuals from public api Adding Label and Visual padding to Button devel api Change-Id: Ib6d790f8821cc74306baa237c78a0fa4b6e4a77c --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp index f60ab87..c67b2ae 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -37,6 +38,10 @@ bool CheckBoxButtonClicked( Button button ) return true; } +static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg"; +const Vector2 TEST_IMAGE_SIZE = Vector2( 66.0f, 66.0f ); + + } // namespace void checkbox_button_startup(void) @@ -213,3 +218,100 @@ int UtcDaliCheckBoxSettingDisabled(void) END_TEST; } + +int UtcDaliCheckBoxSetLabelPadding(void) +{ + tet_infoline("UtcDaliCheckBoxSetLabelPadding\n"); + + ToolkitTestApplication application; + + CheckBoxButton checkBox = CheckBoxButton::New(); + + Property::Map propertyMap; + + propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT ) + .Add( Toolkit::TextVisual::Property::TEXT, "activate" ) + .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f ); + + checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL, propertyMap ); + + application.SendNotification(); + application.Render(); + + Vector3 orginalSize = checkBox.GetNaturalSize(); + + checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL_PADDING, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) ); + + application.SendNotification(); + application.Render(); + + Vector3 paddingAddedSize = checkBox.GetNaturalSize(); + + DALI_TEST_EQUALS( checkBox.GetProperty( Toolkit::DevelButton::Property::LABEL_PADDING ), Vector4( 10.0f, 10.0f, 10.0f, 10.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + + tet_infoline("Comparing original size of button with just text and button size with text and padding\n"); + + DALI_TEST_EQUALS( orginalSize.width +10.0f + 10.0f , paddingAddedSize.width, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + + DALI_TEST_EQUALS( orginalSize.height +10.0f + 10.0f , paddingAddedSize.height, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliCheckBoxSetForegroundPadding(void) +{ + tet_infoline("UtcDaliCheckBoxSetForegroundPadding\n"); + + ToolkitTestApplication application; + + CheckBoxButton checkBox = CheckBoxButton::New(); + + Property::Map propertyMap; + + propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::TEXT ) + .Add( Toolkit::TextVisual::Property::TEXT, "activate" ) + .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f ); + + checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL, propertyMap ); + checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL_PADDING, Vector4( 5.0f, 5.0f, 5.0f, 5.0f ) ); + + application.SendNotification(); + application.Render(); + + tet_printf( "Button RelayoutSize with text(%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height ); + + TestPlatformAbstraction& platform = application.GetPlatform(); + platform.SetClosestImageSize( TEST_IMAGE_SIZE ); + + checkBox.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE ); + checkBox.SetProperty( Toolkit::DevelButton::Property::SELECTED_VISUAL, TEST_IMAGE_ONE ); + + + application.SendNotification(); + application.Render(); + + Vector3 preVisualPaddingSize = checkBox.GetNaturalSize(); + + tet_printf( "Button RelayoutSize with text and icon (%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height ); + + checkBox.SetProperty( Toolkit::DevelButton::Property::VISUAL_PADDING, Vector4( 25.0f, 25.0f, 25.0f, 25.0f ) ); + + application.SendNotification(); + application.Render(); + + Vector3 paddingAddedSize = checkBox.GetNaturalSize(); + + tet_printf( "Button RelayoutSize with text, icon and padding (%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height ); + + DALI_TEST_EQUALS( checkBox.GetProperty( Toolkit::DevelButton::Property::VISUAL_PADDING ), Vector4( 25.0f, 25.0f, 25.0f, 25.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + + tet_infoline("Comparing original size of button before adding padding to visual foreground\n"); + + DALI_TEST_GREATER( paddingAddedSize.width, preVisualPaddingSize.width , TEST_LOCATION ); + + tet_infoline("Text and Visual are side by side, visual height and padding must be greater than text height and padding for this test\n"); + + DALI_TEST_GREATER( paddingAddedSize.height, preVisualPaddingSize.height , TEST_LOCATION ); + + END_TEST; +} diff --git a/build/tizen/dali-toolkit/Makefile.am b/build/tizen/dali-toolkit/Makefile.am index 38f4c89..4ba3e04 100644 --- a/build/tizen/dali-toolkit/Makefile.am +++ b/build/tizen/dali-toolkit/Makefile.am @@ -101,6 +101,7 @@ develapibuilderdir = $(develapidir)/builder develapicontrolsdir = $(develapidir)/controls develapibloomviewdir = $(develapicontrolsdir)/bloom-view develapibubbleemitterdir = $(develapicontrolsdir)/bubble-effect +develapibuttonsdir = $(develapicontrolsdir)/buttons develapieffectsviewdir = $(develapicontrolsdir)/effects-view develapigaussianblurviewdir = $(develapicontrolsdir)/gaussian-blur-view develapimagnifierdir = $(develapicontrolsdir)/magnifier @@ -125,6 +126,7 @@ develapi_HEADERS = $(devel_api_header_files) develapicontrols_HEADERS = $(devel_api_controls_header_files) develapibloomview_HEADERS = $(devel_api_bloom_view_header_files) develapibubbleemitter_HEADERS = $(devel_api_bubble_emitter_header_files) +develapibuttons_HEADERS = $(devel_api_buttons_header_files) develapibuilder_HEADERS = $(devel_api_builder_header_files) develapieffectsview_HEADERS = $(devel_api_effects_view_header_files) develapifocusmanager_HEADERS = $(devel_api_focus_manager_header_files) diff --git a/dali-toolkit/devel-api/controls/buttons/button-devel.h b/dali-toolkit/devel-api/controls/buttons/button-devel.h new file mode 100644 index 0000000..769c8eb --- /dev/null +++ b/dali-toolkit/devel-api/controls/buttons/button-devel.h @@ -0,0 +1,151 @@ +#ifndef __DALI_TOOLKIT_BUTTON_DEVEL_H__ +#define __DALI_TOOLKIT_BUTTON_DEVEL_H__ + +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelButton +{ +/** + * + * @section ButtonProperties Properties + * |%Property enum |String name |Type |Writable|Animatable| + * |-------------------------------------------------------|----------------------------------------|--------------|--------|----------| + * | Property::DISABLED | disabled | BOOLEAN | Y | N | + * | Property::AUTO_REPEATING | autoRepeating | BOOLEAN | Y | N | + * | Property::INITIAL_AUTO_REPEATING_DELAY | initialAutoRepeatingDelay | FLOAT | Y | N | + * | Property::NEXT_AUTO_REPEATING_DELAY | nextAutoRepeatingDelay | FLOAT | Y | N | + * | Property::TOGGLABLE | togglable | BOOLEAN | Y | N | + * | Property::SELECTED | selected | BOOLEAN | Y | N | + * | Property::LABEL | label | MAP | Y | N | + * | Property::UNSELECTED_STATE_VISUAL | unselectedVisual | MAP | Y | N | + * | Property::SELECTED_VISUAL | selectedVisual | MAP | Y | N | + * | Property::DISABLED_SELECTED_VISUAL | disabledSelectedVisual | MAP | Y | N | + * | Property::DISABLED_UNSELECTED_VISUAL | disabledUnselectedVisual | MAP | Y | N | + * | Property::UNSELECTED_BACKGROUND_VISUAL | unselectedBackgroundVisual | MAP | Y | N | + * | Property::SELECTED_BACKGROUND_VISUAL | selectedBackgroundVisual | MAP | Y | N | + * | Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL | disabledUnselectedBackgroundVisual | MAP | Y | N | + * | Property::DISABLED_SELECTED_BACKGROUND_VISUAL | disabledSelectedBackgroundVisual | MAP | Y | N | + * | Property::LABEL_RELATIVE_ALIGNMENT | labelRelativeAlignment | STRING | Y | N | + * ------------------------------------------------------------------------------------------------------------------------------------- + * + * + */ + + namespace Property + { + enum Type + { + DISABLED = Dali::Toolkit::Button::Property::DISABLED, + AUTO_REPEATING = Dali::Toolkit::Button::Property::AUTO_REPEATING, + INITIAL_AUTO_REPEATING_DELAY = Dali::Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY, + NEXT_AUTO_REPEATING_DELAY = Dali::Toolkit::Button::Property:: NEXT_AUTO_REPEATING_DELAY, + TOGGLABLE = Dali::Toolkit::Button::Property::TOGGLABLE, + SELECTED = Dali::Toolkit::Button::Property::SELECTED, + UNSELECTED_STATE_IMAGE = Dali::Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, + SELECTED_STATE_IMAGE = Dali::Toolkit::Button::Property::SELECTED_STATE_IMAGE, + DISABLED_STATE_IMAGE = Dali::Toolkit::Button::Property::DISABLED_STATE_IMAGE, + UNSELECTED_COLOR = Dali::Toolkit::Button::Property::UNSELECTED_COLOR, + SELECTED_COLOR = Dali::Toolkit::Button::Property::SELECTED_COLOR, + LABEL = Dali::Toolkit::Button::Property::LABEL, + LABEL_TEXT = Dali::Toolkit::Button::Property::LABEL_TEXT, + + /** + * @brief name "unselectedVisual", type string if it is a url, map otherwise + * @details Sets the unselected button foreground/icon visual + */ + UNSELECTED_VISUAL = LABEL_TEXT + 1, + + /** + * @brief name "selectedImage", type string if it is a url, map otherwise + * @details Sets the selected button foreground/icon visual + * @SINCE_1_2.18 + */ + SELECTED_VISUAL, + + /** + * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise + * @details Sets the disabled selected state foreground/icon button visual + */ + DISABLED_SELECTED_VISUAL, + + /** + * @brief name "disabledUnSelectedVisual", type string if it is a url, map otherwise + * @details Sets the disabled unselected state foreground/icon visual + */ + DISABLED_UNSELECTED_VISUAL, + + /** + * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the disabled in the unselected state background, button visual + */ + UNSELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the selected background button visual + */ + SELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the disabled while unselected background button visual + */ + DISABLED_UNSELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise + * @details Sets the disabled while selected background button visual + */ + DISABLED_SELECTED_BACKGROUND_VISUAL, + + /** + * @brief name "labelRelativeAlignment", type STRING + * @details Sets the position of the the label in relation to the foreground/icon if both present + */ + LABEL_RELATIVE_ALIGNMENT, + + /** + * @brief name "labelPadding", type Vector4 + * @details Sets the padding around the text + */ + LABEL_PADDING, + + /** + * @brief name "visualPadding", type Vector4 + * @details Sets the padding around the foreground visual + */ + VISUAL_PADDING + }; + } // namespace Property + +} // namespace DevelButton + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_BUTTON_DEVEL_H__ diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index 6afe30c..566949b 100644 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -51,6 +51,9 @@ devel_api_bloom_view_header_files = \ devel_api_bubble_emitter_header_files = \ $(devel_api_src_dir)/controls/bubble-effect/bubble-emitter.h +devel_api_buttons_header_files = \ + $(devel_api_src_dir)/controls/buttons/button-devel.h + devel_api_builder_header_files = \ $(devel_api_src_dir)/builder/builder.h \ $(devel_api_src_dir)/builder/json-parser.h \ diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index a984156..661e3b2 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -27,16 +27,17 @@ #include #include #include +#include #include // INTERNAL INCLUDES #include #include #include -#include #include #include #include +#include #include #include #include @@ -79,15 +80,17 @@ DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedColor", DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedColor", VECTOR4, SELECTED_COLOR ) // Deprecated property DALI_PROPERTY_REGISTRATION( Toolkit, Button, "label", MAP, LABEL ) DALI_PROPERTY_REGISTRATION( Toolkit, Button, "labelText", STRING, LABEL_TEXT ) // Deprecated property -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedVisual", MAP, UNSELECTED_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedVisual", MAP, SELECTED_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedVisual", MAP, DISABLED_SELECTED_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedVisual", MAP, DISABLED_UNSELECTED_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedBackgroundVisual", MAP, UNSELECTED_BACKGROUND_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedBackgroundVisual", MAP, SELECTED_BACKGROUND_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedBackgroundVisual", MAP, DISABLED_UNSELECTED_BACKGROUND_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedBackgroundVisual", MAP, DISABLED_SELECTED_BACKGROUND_VISUAL ) -DALI_PROPERTY_REGISTRATION( Toolkit, Button, "labelRelativeAlignment", STRING, LABEL_RELATIVE_ALIGNMENT ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedVisual", MAP, UNSELECTED_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "selectedVisual", MAP, SELECTED_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedVisual", MAP, DISABLED_SELECTED_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedVisual", MAP, DISABLED_UNSELECTED_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedBackgroundVisual", MAP, UNSELECTED_BACKGROUND_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "selectedBackgroundVisual", MAP, SELECTED_BACKGROUND_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedBackgroundVisual", MAP, DISABLED_UNSELECTED_BACKGROUND_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedBackgroundVisual", MAP, DISABLED_SELECTED_BACKGROUND_VISUAL ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "labelRelativeAlignment", STRING, LABEL_RELATIVE_ALIGNMENT ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "labelPadding", VECTOR4, LABEL_PADDING ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "visualPadding", VECTOR4, VISUAL_PADDING ) // Signals: DALI_SIGNAL_REGISTRATION( Toolkit, Button, "pressed", SIGNAL_PRESSED ) @@ -119,10 +122,10 @@ const unsigned int ALIGNMENT_STRING_TABLE_COUNT = sizeof( ALIGNMENT_STRING_TABLE const Property::Index GET_VISUAL_INDEX_FOR_STATE[][Button::STATE_COUNT] = { - { Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::UNSELECTED_VISUAL }, - { Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::SELECTED_VISUAL }, - { Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL }, - { Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::DISABLED_SELECTED_VISUAL } + { Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::UNSELECTED_VISUAL }, + { Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::SELECTED_VISUAL }, + { Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL }, + { Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL } }; /** @@ -1138,32 +1141,32 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope case Toolkit::Button::Property::UNSELECTED_STATE_IMAGE: // Legacy Tizen 3.0 { - GetImplementation( button ).CreateVisualsForComponent( Toolkit::Button::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT ); + GetImplementation( button ).CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT ); break; } case Toolkit::Button::Property::DISABLED_STATE_IMAGE: // Legacy Tizen 3.0 { - GetImplementation( button ).CreateVisualsForComponent( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, value, DepthIndex::CONTENT ); + GetImplementation( button ).CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, value, DepthIndex::CONTENT ); break; } case Toolkit::Button::Property::SELECTED_STATE_IMAGE: // Legacy Tizen 3.0 { - GetImplementation( button ).CreateVisualsForComponent( Toolkit::Button::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT ); + GetImplementation( button ).CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT ); break; } - case Toolkit::Button::Property::UNSELECTED_VISUAL: - case Toolkit::Button::Property::SELECTED_VISUAL: - case Toolkit::Button::Property::DISABLED_SELECTED_VISUAL: - case Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL: + case Toolkit::DevelButton::Property::UNSELECTED_VISUAL: + case Toolkit::DevelButton::Property::SELECTED_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL: { GetImplementation( button ).CreateVisualsForComponent( index, value, DepthIndex::CONTENT ); break; } - case Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL: - case Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL: - case Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL: - case Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL: { GetImplementation( button ).CreateVisualsForComponent( index , value, DepthIndex::BACKGROUND); break; @@ -1172,14 +1175,14 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope case Toolkit::Button::Property::UNSELECTED_COLOR: { DALI_LOG_WARNING("[%s] Using deprecated Property Button::Property::UNSELECTED_COLOR instead use Button::Property::UNSELECTED_BACKGROUND_VISUAL\n", __FUNCTION__); - GetImplementation( button ).SetColor( value.Get< Vector4 >(), Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL ); + GetImplementation( button ).SetColor( value.Get< Vector4 >(), Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL ); break; } case Toolkit::Button::Property::SELECTED_COLOR: { DALI_LOG_WARNING("[%s] Using deprecated Property Button::Property::SELECTED_COLOR instead use Button::Property::SELECTED_BACKGROUND_VISUAL\n", __FUNCTION__); - GetImplementation( button ).SetColor( value.Get< Vector4 >(), Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL ); + GetImplementation( button ).SetColor( value.Get< Vector4 >(), Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL ); break; } @@ -1204,7 +1207,7 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope break; } - case Toolkit::Button::Property::LABEL_RELATIVE_ALIGNMENT: + case Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT: { Button::Align labelAlignment(END); Scripting::GetEnumeration< Button::Align> ( value.Get< std::string >().c_str(), @@ -1212,6 +1215,22 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope labelAlignment ); GetImplementation( button ).SetLabelAlignment( labelAlignment ); + GetImplementation( button ).RelayoutRequest(); + break; + } + + case Toolkit::DevelButton::Property::LABEL_PADDING: + { + Vector4 padding ( value.Get< Vector4 >() ); + GetImplementation( button ).SetLabelPadding( Padding( padding.x, padding.y, padding.z, padding.w ) ); + break; + } + + case Toolkit::DevelButton::Property::VISUAL_PADDING: + { + Vector4 padding ( value.Get< Vector4 >() ); + GetImplementation( button ).SetForegroundPadding( Padding( padding.x, padding.y, padding.z, padding.w ) ); + GetImplementation( button ).RelayoutRequest(); break; } } @@ -1266,30 +1285,30 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert case Toolkit::Button::Property::UNSELECTED_STATE_IMAGE: { - value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::Button::Property::UNSELECTED_VISUAL ); + value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL ); break; } case Toolkit::Button::Property::SELECTED_STATE_IMAGE: { - value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::Button::Property::SELECTED_VISUAL ); + value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL ); break; } case Toolkit::Button::Property::DISABLED_STATE_IMAGE: { - value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL ); + value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL ); break; } - case Toolkit::Button::Property::UNSELECTED_VISUAL: - case Toolkit::Button::Property::SELECTED_VISUAL: - case Toolkit::Button::Property::DISABLED_SELECTED_VISUAL: - case Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL: - case Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL: - case Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL: - case Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL: - case Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::UNSELECTED_VISUAL: + case Toolkit::DevelButton::Property::SELECTED_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL: + case Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL: + case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL: case Toolkit::Button::Property::LABEL: { Property::Map visualProperty; @@ -1318,7 +1337,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert break; } - case Toolkit::Button::Property::LABEL_RELATIVE_ALIGNMENT: + case Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT: { const char* alignment = Scripting::GetEnumerationName< Button::Align >( GetImplementation( button ).GetLabelAlignment(), ALIGNMENT_STRING_TABLE, @@ -1330,6 +1349,19 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert break; } + + case Toolkit::DevelButton::Property::LABEL_PADDING: + { + Padding padding = GetImplementation( button ).GetLabelPadding(); + value = Vector4( padding.x, padding.y, padding.top, padding.bottom); + break; + } + + case Toolkit::DevelButton::Property::VISUAL_PADDING: + { + Padding padding = GetImplementation( button ).GetForegroundPadding(); + value = Vector4( padding.x, padding.y, padding.top, padding.bottom); + } } } @@ -1366,7 +1398,7 @@ Padding Button::GetForegroundPadding() // Legacy code needed whilst Color can be set by direct Property setting ( deprecated ) instead of setting a Visual void Button::SetColor( const Vector4& color, Property::Index visualIndex ) { - if ( visualIndex == Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL ) + if ( visualIndex == Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL ) { mSelectedColor = color; } @@ -1419,7 +1451,7 @@ void Button::SetUnselectedImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::UNSELECTED_VISUAL, filename, DepthIndex::CONTENT ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, filename, DepthIndex::CONTENT ); } } @@ -1427,7 +1459,7 @@ void Button::SetBackgroundImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND ); } } @@ -1435,7 +1467,7 @@ void Button::SetSelectedImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::SELECTED_VISUAL, filename, DepthIndex::CONTENT ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_VISUAL, filename, DepthIndex::CONTENT ); } } @@ -1443,7 +1475,7 @@ void Button::SetSelectedBackgroundImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND ); } } @@ -1451,7 +1483,7 @@ void Button::SetDisabledBackgroundImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND ); } } @@ -1459,7 +1491,7 @@ void Button::SetDisabledImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, filename, DepthIndex::CONTENT ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, filename, DepthIndex::CONTENT ); } } @@ -1467,7 +1499,7 @@ void Button::SetDisabledSelectedImage( const std::string& filename ) { if( !filename.empty() ) { - CreateVisualsForComponent( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, filename, DepthIndex::CONTENT ); + CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, filename, DepthIndex::CONTENT ); } } @@ -1526,7 +1558,7 @@ void Button::SetSelectedImage( Image image ) Actor Button::GetButtonImage() const { DALI_LOG_WARNING("Button::GetButtonImage @DEPRECATED_1_0.50\n"); - Actor imageView = Toolkit::ImageView::New( GetUrlForImageVisual( Toolkit::Button::Property::UNSELECTED_VISUAL ) ); + Actor imageView = Toolkit::ImageView::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL ) ); return imageView; } @@ -1534,7 +1566,7 @@ Actor Button::GetButtonImage() const Actor Button::GetSelectedImage() const { DALI_LOG_WARNING("Button::GetSelectedImage @DEPRECATED_1_0.50\n"); - Actor imageView = Toolkit::ImageView::New( GetUrlForImageVisual( Toolkit::Button::Property::SELECTED_VISUAL ) ); + Actor imageView = Toolkit::ImageView::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL ) ); return imageView; } diff --git a/dali-toolkit/internal/controls/buttons/button-impl.h b/dali-toolkit/internal/controls/buttons/button-impl.h index dc123cc..a079cd5 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.h +++ b/dali-toolkit/internal/controls/buttons/button-impl.h @@ -24,7 +24,7 @@ // INTERNAL INCLUDES #include -#include +#include #include namespace Dali diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.cpp b/dali-toolkit/internal/controls/buttons/push-button-impl.cpp index 4e96f14..3391bae 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #if defined(DEBUG_ENABLED) extern Debug::Filter* gLogButtonFilter; @@ -164,12 +165,12 @@ void PushButton::SetProperty( BaseObject* object, Property::Index propertyIndex, { case Toolkit::PushButton::Property::UNSELECTED_ICON: { - pushButtonImpl.CreateVisualsForComponent( Toolkit::Button::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT ); + pushButtonImpl.CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT ); break; } case Toolkit::PushButton::Property::SELECTED_ICON: { - pushButtonImpl.CreateVisualsForComponent( Toolkit::Button::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT ); + pushButtonImpl.CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT ); break; } case Toolkit::PushButton::Property::ICON_ALIGNMENT: diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index 68b2567..3ccf2d4 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -61,44 +61,15 @@ class Button; * * 'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer. * - * The button's appearance can be modified by setting properties for the various images. + * The button's appearance can be modified by setting properties for the various visuals/images. * * It is not mandatory to set all visuals. A button could be defined only by setting its \e background visual or by setting its \e background and \e selected visuals. * - * The \e button visual is shown over the \e background visual.. + * The \e button visual is shown over the \e background visual. * When pressed the unselected visuals are replaced by the \e selected visual. The text label is always placed on the top of all images. * * When the button is disabled, \e background, \e button and \e selected visuals are replaced by their \e disabled visuals. * - - * - * @brief A control which renders a short text string. - * - * Text labels are lightweight, non-editable and do not respond to user input. - * - * - * @section ButtonProperties Properties - * |%Property enum |String name |Type |Writable|Animatable| - * |-------------------------------------------------------|----------------------------------------|--------------|--------|----------| - * | Property::DISABLED | disabled | BOOLEAN | Y | N | - * | Property::AUTO_REPEATING | autoRepeating | BOOLEAN | Y | N | - * | Property::INITIAL_AUTO_REPEATING_DELAY | initialAutoRepeatingDelay | FLOAT | Y | N | - * | Property::NEXT_AUTO_REPEATING_DELAY | nextAutoRepeatingDelay | FLOAT | Y | N | - * | Property::TOGGLABLE | togglable | BOOLEAN | Y | N | - * | Property::SELECTED | selected | BOOLEAN | Y | N | - * | Property::LABEL | label | MAP | Y | N | - * | Property::UNSELECTED_STATE_VISUAL | unselectedVisual | MAP | Y | N | - * | Property::SELECTED_VISUAL | selectedVisual | MAP | Y | N | - * | Property::DISABLED_SELECTED_VISUAL | disabledSelectedVisual | MAP | Y | N | - * | Property::DISABLED_UNSELECTED_VISUAL | disabledUnselectedVisual | MAP | Y | N | - * | Property::UNSELECTED_BACKGROUND_VISUAL | unselectedBackgroundVisual | MAP | Y | N | - * | Property::SELECTED_BACKGROUND_VISUAL | selectedBackgroundVisual | MAP | Y | N | - * | Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL | disabledUnselectedBackgroundVisual | MAP | Y | N | - * | Property::DISABLED_SELECTED_BACKGROUND_VISUAL | disabledSelectedBackgroundVisual | MAP | Y | N | - * | Property::LABEL_RELATIVE_ALIGNMENT | labelRelativeAlignment | STRING | Y | N | - * ------------------------------------------------------------------------------------------------------------------------------------- - * - * Note, *_VISUAL properties of type MAP can also be passed a uri of type STRING * * Signals * | %Signal Name | Method | @@ -231,70 +202,7 @@ public: * @brief name "labelText", type std::string * @SINCE_1_0.0 */ - LABEL_TEXT, - - /** - * @brief name "unselectedVisual", type string if it is a url, map otherwise - * @details Sets the unselected button foreground/icon visual - * @SINCE_1_2.XX - */ - UNSELECTED_VISUAL, - - /** - * @brief name "selectedImage", type string if it is a url, map otherwise - * @details Sets the selected button foreground/icon visual - * @SINCE_1_2.XX - */ - SELECTED_VISUAL, - - /** - * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise - * @details Sets the disabled selected state foreground/icon button visual - * @SINCE_1_2.XX - */ - DISABLED_SELECTED_VISUAL, - - /** - * @brief name "disabledUnSelectedVisual", type string if it is a url, map otherwise - * @details Sets the disabled unselected state foreground/icon visual - * @SINCE_1_2.XX - */ - DISABLED_UNSELECTED_VISUAL, - - /** - * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise - * @details Sets the disabled in the unselected state background, button visual - * @SINCE_1_2.XX - */ - UNSELECTED_BACKGROUND_VISUAL, - - /** - * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise - * @details Sets the selected background button visual - * @SINCE_1_2.XX - */ - SELECTED_BACKGROUND_VISUAL, - - /** - * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise - * @details Sets the disabled while unselected background button visual - * @SINCE_1_2.XX - */ - DISABLED_UNSELECTED_BACKGROUND_VISUAL, - - /** - * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise - * @details Sets the disabled while selected background button visual - * @SINCE_1_2.XX - */ - DISABLED_SELECTED_BACKGROUND_VISUAL, - - /** - * @brief name "labelRelativeAlignment", type STRING - * @details Sets the position of the the label in relation to the foreground/icon if both present - * @SINCE_1_2.XX - */ - LABEL_RELATIVE_ALIGNMENT, + LABEL_TEXT }; }; @@ -528,10 +436,10 @@ public: void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use styling - * Use Property::UNSELECTED_BACKGROUND_VISUAL + * @DEPRECATED_1_1.32 Use styling Set Control::Property::BACKGROUND which is same as un-selected background + * Or use DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL * - * @brief Sets the unselected background image. + * @brief Sets the background image. * * @SINCE_1_0.0 * @param[in] filename The background image. @@ -549,8 +457,8 @@ public: void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_2.32 Use styling file - * Use Property::SELECTED_BACKGROUND_VISUAL + * @DEPRECATED_1_1.32 Set Control::Property::BACKGROUND which is same as un-selected background + * Or use DevelButton::Property::SELECTED_BACKGROUND_VISUAL * * @brief Sets the selected background image. * @@ -560,8 +468,8 @@ public: void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use styling file - * Use Property::DISABLED_SELECTED_BACKGROUND_VISUAL + * @DEPRECATED_1_1.32 Only able to set Property::DISABLED_STATE_IMAGE + * Or use DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL * * @brief Sets the disabled background image. * @@ -581,8 +489,8 @@ public: void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API; /** - * @DEPRECATED_1_1.32 Use styling file - * Use Property::DISABLED_SELECTED_VISUAL + * @DEPRECATED_1_1.32 Use Property::DISABLED_STATE_IMAGE which provides same disabled image for un/selected + * Or DevelButton::Property::DISABLED_SELECTED_VISUAL to disable selected visual. * * @brief Sets the disabled selected button image. * diff --git a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json index 78b8a87..4f33d78 100644 --- a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json @@ -163,14 +163,7 @@ "Button": { "initialAutoRepeatingDelay":2.0, - "nextAutoRepeatingDelay":0.9, - "label": - { - "visualType": "TEXT", - "horizontalAlignment": "CENTER", - "pointSize" : 15.0, // Point size must always be provided to Text Visual - "verticalAlignment": "CENTER" - } + "nextAutoRepeatingDelay":0.9 // Note: Visuals added to Button will be used in all derived buttons unless overridden. }, "PushButton": @@ -179,6 +172,13 @@ "autoRepeating":false, "togglable":false, "labelPadding":[ 12.0, 12.0, 12.0, 12.0 ], + "label": + { + "visualType": "TEXT", + "horizontalAlignment": "CENTER", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedBackgroundVisual": { "visualType": "IMAGE", @@ -203,6 +203,13 @@ "CheckBoxButton": { "styles":["Button"], + "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ], + "label": + { + "visualType": "TEXT", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedBackgroundVisual": { "visualType": "IMAGE", @@ -227,6 +234,13 @@ "RadioButton": { "styles":["Button"], + "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ], + "label": + { + "visualType": "TEXT", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedBackgroundVisual": { "visualType": "IMAGE", diff --git a/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json b/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json index 7bc8ffb..970fb13 100644 --- a/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/480x800/dali-toolkit-default-theme.json @@ -210,14 +210,7 @@ "Button": { "initialAutoRepeatingDelay":2.0, - "nextAutoRepeatingDelay":0.9, - "label": - { - "visualType": "TEXT", - "horizontalAlignment": "CENTER", - "pointSize" : 15.0, // Point size must always be provided to Text Visual - "verticalAlignment": "CENTER" - } + "nextAutoRepeatingDelay":0.9 // Note: Visuals added to Button will be used in all derived buttons unless overridden. }, "PushButton": @@ -226,6 +219,13 @@ "autoRepeating":false, "togglable":false, "labelPadding":[ 12.0, 12.0, 12.0, 12.0 ], + "label": + { + "visualType": "TEXT", + "horizontalAlignment": "CENTER", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedBackgroundVisual": { "visualType": "IMAGE", @@ -250,6 +250,13 @@ "CheckBoxButton": { "styles":["Button"], + "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ], + "label": + { + "visualType": "TEXT", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedVisual": { "visualType": "IMAGE", @@ -274,6 +281,13 @@ "RadioButton": { "styles":["Button"], + "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ], + "label": + { + "visualType": "TEXT", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedVisual": { "visualType": "IMAGE", diff --git a/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json b/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json index 5bf3c13..aec2ff3 100644 --- a/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json @@ -218,14 +218,7 @@ "Button": { "initialAutoRepeatingDelay":2.0, - "nextAutoRepeatingDelay":0.9, - "label": - { - "visualType": "TEXT", - "horizontalAlignment": "CENTER", - "pointSize" : 15.0, // Point size must always be provided to Text Visual - "verticalAlignment": "CENTER" - } + "nextAutoRepeatingDelay":0.9 // Note: Visuals added to Button will be used in all derived buttons unless overridden. }, "PushButton": @@ -234,6 +227,13 @@ "autoRepeating":false, "togglable":false, "labelPadding":[ 12.0, 12.0, 12.0, 12.0 ], + "label": + { + "visualType": "TEXT", + "horizontalAlignment": "CENTER", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedBackgroundVisual": { "visualType": "IMAGE", @@ -258,6 +258,13 @@ "CheckBoxButton": { "styles":["Button"], + "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ], + "label": + { + "visualType": "TEXT", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedVisual": { "visualType": "IMAGE", @@ -282,6 +289,13 @@ "RadioButton": { "styles":["Button"], + "labelPadding":[ 12.0, 12.0, 0.0, 0.0 ], + "label": + { + "visualType": "TEXT", + "pointSize" : 15.0, // Point size must always be provided to Text Visual + "verticalAlignment": "CENTER" + }, "unselectedVisual": { "visualType": "IMAGE",