From: Francisco Santos Date: Thu, 29 May 2014 05:47:29 +0000 (+0900) Subject: Add new API to ScrollBar to set background and indicator images. X-Git-Tag: dali_1.0.0~75 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=1f49cc894b0c8c769f4b34f3a0e7084ce686b664;hp=f9adfdbd2c44b9648726bb0a1d8db863407f84bd Add new API to ScrollBar to set background and indicator images. [problem] API forces application to provide a border even when using automatic 9 patch images. [cause] API was designed for old nine patch. [solution] Provide new API and deprecate old API. Change-Id: Ie223643e8334f77e836ebcdd78cbf0b106a340c5 Signed-off-by: Francisco Santos --- diff --git a/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index db2fdc7..1def8eb 100755 --- a/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -198,11 +198,15 @@ void ScrollBar::SetBackgroundImage( Image image, const Vector4& border ) { mBackground.SetImage(image); } - mBackground.SetNinePatchBorder( border ); mBackground.SetStyle( ImageActor::STYLE_NINE_PATCH ); } +void ScrollBar::SetIndicatorImage( Image image ) +{ + mIndicator.SetImage(image); +} + void ScrollBar::SetIndicatorImage( Image image, const Vector4& border ) { mIndicator.SetImage(image); diff --git a/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h b/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h index 0b4c344..a572231 100755 --- a/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h +++ b/base/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h @@ -84,6 +84,11 @@ public: /** * @copydoc Toolkit::ScrollBar::SetIndicatorImage() */ + void SetIndicatorImage( Image image ); + + /** + * @copydoc Toolkit::ScrollBar::SetIndicatorImage() + */ void SetIndicatorImage( Image image, const Vector4& border ); /** diff --git a/base/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp b/base/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp index 94eb45e..c1b8ab4 100755 --- a/base/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp +++ b/base/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.cpp @@ -73,6 +73,11 @@ void ScrollBar::SetBackgroundImage( Image image, const Vector4& border ) GetImpl(*this).SetBackgroundImage(image, border); } +void ScrollBar::SetIndicatorImage( Image image ) +{ + GetImpl(*this).SetIndicatorImage(image); +} + void ScrollBar::SetIndicatorImage( Image image, const Vector4& border ) { GetImpl(*this).SetIndicatorImage(image, border); diff --git a/capi/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h b/capi/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h index d48304d..4e150cd 100755 --- a/capi/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h +++ b/capi/dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h @@ -111,8 +111,23 @@ public: * * @param[in] image The image to cover background * @param[in] border The nine patch border for the image. + * + * @deprecated Use Control::SetBackground() + */ + void SetBackgroundImage( Image image, const Vector4& border ); + + /** + * @brief Sets the image for the indicator of scroll bar. + * + * @pre The scroll bar actor has been initialised. + * + * The indicator image is resized (stretched according to scale settings), + * to reflect the size of the scroll indicator and minimum/maximum limits + * of the scroll position. + * + * @param[in] image The image of indicator that moves to indicate the current scroll position. */ - void SetBackgroundImage( Image image, const Vector4& border ); + void SetIndicatorImage( Image image ); /** * @brief Sets the image for the indicator of scroll bar. @@ -125,6 +140,8 @@ public: * * @param[in] image The image of indicator that moves to indicate the current scroll position. * @param[in] border The nine patch border for the image. + * + * @deprecated Use the new 9-patch API */ void SetIndicatorImage( Image image, const Vector4& border );