Disabled state in tabbar
authorvipul <vipul.kumar@samsung.com>
Thu, 27 Jun 2013 11:29:52 +0000 (16:59 +0530)
committervipul <vipul.kumar@samsung.com>
Wed, 3 Jul 2013 11:16:16 +0000 (16:46 +0530)
Signed-off-by: vipul <vipul.kumar@samsung.com>
Change-Id: I7ba5e68a82f348573c5540dc0f9f9bfff927591d

src/ui/controls/FUiCtrl_TabBar.cpp
src/ui/controls/FUiCtrl_TabBarPresenter.cpp
src/ui/inc/FUiCtrl_TabBar.h
src/ui/inc/FUiCtrl_TabBarItem.h
src/ui/inc/FUiCtrl_TabBarPresenter.h
src/ui/inc/FUi_ResourceTabBarConfig.h
src/ui/resource/FUi_ResourceConfigParser.cpp
src/ui/resource/FUi_ResourceTabBarConfig.cpp

index c67bed0..5408b21 100644 (file)
@@ -47,11 +47,12 @@ _TabBar::_TabBar()
 
        GET_COLOR_CONFIG(TABBAR::ITEM_BG_NORMAL, __itemColor[ITEM_STATUS_NORMAL]);
        GET_COLOR_CONFIG(TABBAR::ITEM_BG_SELECTED, __itemColor[ITEM_STATUS_SELECTED]);
-       GET_COLOR_CONFIG(TABBAR::ITEM_BG_PRESSED, __itemColor[ITEM_STATUS_HIGHLIGHTED]);
+       GET_COLOR_CONFIG(TABBAR::ITEM_BG_PRESSED, __itemColor[ITEM_STATUS_PRESSED]);
+       GET_COLOR_CONFIG(TABBAR::ITEM_BG_DISABLED, __itemColor[ITEM_STATUS_DISABLED]);
 
        GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_NORMAL, __itemTextColor[ITEM_STATUS_NORMAL]);
        GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_SELECTED, __itemTextColor[ITEM_STATUS_SELECTED]);
-       GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_PRESSED, __itemTextColor[ITEM_STATUS_HIGHLIGHTED]);
+       GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_PRESSED, __itemTextColor[ITEM_STATUS_PRESSED]);
        GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_DISABLED, __itemTextColor[ITEM_STATUS_DISABLED]);
 }
 
@@ -234,23 +235,43 @@ _TabBar::GetPropertySelectedItemColor(void) const
 }
 
 result
-_TabBar::SetPropertyHighlightedItemColor(const Variant& color)
+_TabBar::SetPropertyPressedItemColor(const Variant& color)
 {
        result r = E_SUCCESS;
 
-       r = __pTabBarPresenter->SetItemReplacementColor(ITEM_STATUS_HIGHLIGHTED, color.ToColor());
+       r = __pTabBarPresenter->SetItemReplacementColor(ITEM_STATUS_PRESSED, color.ToColor());
        if (r == E_SUCCESS)
        {
-               __itemColor[ITEM_STATUS_HIGHLIGHTED] = color.ToColor();
+               __itemColor[ITEM_STATUS_PRESSED] = color.ToColor();
        }
 
        return r;
 }
 
 Variant
-_TabBar::GetPropertyHighlightedItemColor(void) const
+_TabBar::GetPropertyPressedItemColor(void) const
 {
-       return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_HIGHLIGHTED]);
+       return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_PRESSED]);
+}
+
+result
+_TabBar::SetPropertyDisabledItemColor(const Variant& color)
+{
+       result r = E_SUCCESS;
+
+       r = __pTabBarPresenter->SetItemReplacementColor(ITEM_STATUS_DISABLED, color.ToColor());
+       if (r == E_SUCCESS)
+       {
+               __itemColor[ITEM_STATUS_DISABLED] = color.ToColor();
+       }
+
+       return r;
+}
+
+Variant
+_TabBar::GetPropertyDisabledItemColor(void) const
+{
+       return Tizen::Ui::Variant(__itemColor[ITEM_STATUS_DISABLED]);
 }
 
 result
@@ -266,9 +287,13 @@ _TabBar::SetItemColor(_TabBarItemStatus itemStatus, Tizen::Graphics::Color color
        {
                r = SetProperty("selectedItemColor", Variant(color));
        }
+       else if (itemStatus == ITEM_STATUS_PRESSED)
+       {
+               r = SetProperty("pressedItemColor", Variant(color));
+       }
        else
        {
-               r = SetProperty("highlightedItemColor", Variant(color));
+               r = SetProperty("disabledItemColor", Variant(color));
        }
 
        return r;
@@ -289,9 +314,14 @@ _TabBar::GetItemColor(_TabBarItemStatus itemStatus) const
                Variant color = GetProperty("selectedItemColor");
                itemColor = color.ToColor();
        }
+       else if (itemStatus == ITEM_STATUS_PRESSED)
+       {
+               Variant color = GetProperty("pressedItemColor");
+               itemColor = color.ToColor();
+       }
        else
        {
-               Variant color = GetProperty("highlightedItemColor");
+               Variant color = GetProperty("disabledItemColor");
                itemColor = color.ToColor();
        }
 
@@ -327,17 +357,17 @@ _TabBar::GetPropertySelectedItemTextColor(void) const
 }
 
 result
-_TabBar::SetPropertyHighlightedItemTextColor(const Variant & color)
+_TabBar::SetPropertyPressedItemTextColor(const Variant & color)
 {
-       __itemTextColor[ITEM_STATUS_HIGHLIGHTED] = color.ToColor();
+       __itemTextColor[ITEM_STATUS_PRESSED] = color.ToColor();
 
        return E_SUCCESS;
 }
 
 Variant
-_TabBar::GetPropertyHighlightedItemTextColor(void) const
+_TabBar::GetPropertyPressedItemTextColor(void) const
 {
-       return Tizen::Ui::Variant(__itemTextColor[ITEM_STATUS_HIGHLIGHTED]);
+       return Tizen::Ui::Variant(__itemTextColor[ITEM_STATUS_PRESSED]);
 }
 
 result
@@ -370,7 +400,7 @@ _TabBar::SetItemTextColor(_TabBarItemStatus status, Tizen::Graphics::Color color
        }
        else
        {
-               r = SetProperty("highlightedItemTextColor", Variant(color));
+               r = SetProperty("pressedItemTextColor", Variant(color));
        }
 
        if (r != E_SUCCESS)
@@ -395,9 +425,9 @@ _TabBar::GetItemTextColor(_TabBarItemStatus status) const
                Variant color = GetProperty("selectedItemTextColor");
                itemTextColor = color.ToColor();
        }
-       else if (status == ITEM_STATUS_HIGHLIGHTED)
+       else if (status == ITEM_STATUS_PRESSED)
        {
-               Variant color = GetProperty("highlightedItemTextColor");
+               Variant color = GetProperty("pressedItemTextColor");
                itemTextColor = color.ToColor();
        }
        else
@@ -567,53 +597,53 @@ _TabBar::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 
        if (keyCode == _KEY_RIGHT)
        {
-               if (__currentHighlightedItemIndex < (itemCount - 1))
+               if (__currentPressedItemIndex < (itemCount - 1))
                {
-                       if (__pTabBarPresenter->GetItemStatus(__currentHighlightedItemIndex) != ITEM_STATUS_SELECTED)
+                       if (__pTabBarPresenter->GetItemStatus(__currentPressedItemIndex) != ITEM_STATUS_SELECTED)
                        {
-                               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_NORMAL);
+                               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_NORMAL);
                        }
 
-                       __currentHighlightedItemIndex++;
+                       __currentPressedItemIndex++;
 
-                       if (__pTabBarPresenter->GetItemStatus(__currentHighlightedItemIndex) != ITEM_STATUS_SELECTED)
+                       if (__pTabBarPresenter->GetItemStatus(__currentPressedItemIndex) != ITEM_STATUS_SELECTED)
                        {
-                               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_HIGHLIGHTED);
+                               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_PRESSED);
                        }
-                       __pTabBarPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_RIGHT);
+                       __pTabBarPresenter->ShiftToFocusedItem(__currentPressedItemIndex, _FOCUS_DIRECTION_MOVE_RIGHT);
                }
                return true;
        }
 
        if (keyCode == _KEY_LEFT)
        {
-               if (__currentHighlightedItemIndex >= -1)
+               if (__currentPressedItemIndex >= -1)
                {
-                       if (__pTabBarPresenter->GetItemStatus(__currentHighlightedItemIndex) != ITEM_STATUS_SELECTED)
+                       if (__pTabBarPresenter->GetItemStatus(__currentPressedItemIndex) != ITEM_STATUS_SELECTED)
                        {
-                               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_NORMAL);
+                               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_NORMAL);
                        }
-                       if (__currentHighlightedItemIndex == -1)
+                       if (__currentPressedItemIndex == -1)
                        {
-                               __currentHighlightedItemIndex = 0;
+                               __currentPressedItemIndex = 0;
                        }
-                       if (__currentHighlightedItemIndex > 0)
+                       if (__currentPressedItemIndex > 0)
                        {
-                               __currentHighlightedItemIndex--;
+                               __currentPressedItemIndex--;
                        }
-                       if (__pTabBarPresenter->GetItemStatus(__currentHighlightedItemIndex) != ITEM_STATUS_SELECTED)
+                       if (__pTabBarPresenter->GetItemStatus(__currentPressedItemIndex) != ITEM_STATUS_SELECTED)
                        {
-                               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_HIGHLIGHTED);
+                               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_PRESSED);
                        }
-                       __pTabBarPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
+                       __pTabBarPresenter->ShiftToFocusedItem(__currentPressedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
                }
                return true;
        }
 
-       if (keyCode == _KEY_ENTER && __currentHighlightedItemIndex != -1)
+       if (keyCode == _KEY_ENTER && __currentPressedItemIndex != -1)
        {
-               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_SELECTED);
-               __pTabBarPresenter->SetItemSelected(__currentHighlightedItemIndex);
+               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_SELECTED);
+               __pTabBarPresenter->SetItemSelected(__currentPressedItemIndex);
                Invalidate();
                return true;
        }
@@ -631,19 +661,19 @@ _TabBar::OnDrawFocus(void)
 {
        if (__pTabBarPresenter->GetItemCount() > 0)
        {
-               __currentHighlightedItemIndex = 0;
+               __currentPressedItemIndex = 0;
        }
        else
        {
-               __currentHighlightedItemIndex = -1;
+               __currentPressedItemIndex = -1;
        }
 
-       if (__pTabBarPresenter->GetItemStatus(__currentHighlightedItemIndex) != ITEM_STATUS_SELECTED)
+       if (__pTabBarPresenter->GetItemStatus(__currentPressedItemIndex) != ITEM_STATUS_SELECTED)
        {
-               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_HIGHLIGHTED);
+               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_PRESSED);
        }
 
-       __pTabBarPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
+       __pTabBarPresenter->ShiftToFocusedItem(__currentPressedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
        __isInFocusMode = true;
 
        return;
@@ -652,12 +682,12 @@ _TabBar::OnDrawFocus(void)
 void
 _TabBar::OnFocusModeStateChanged(void)
 {
-       if (__pTabBarPresenter->GetItemStatus(__currentHighlightedItemIndex) == ITEM_STATUS_HIGHLIGHTED)
+       if (__pTabBarPresenter->GetItemStatus(__currentPressedItemIndex) == ITEM_STATUS_PRESSED)
        {
-               __pTabBarPresenter->SetItemStatus(__currentHighlightedItemIndex, ITEM_STATUS_NORMAL);
+               __pTabBarPresenter->SetItemStatus(__currentPressedItemIndex, ITEM_STATUS_NORMAL);
        }
 
-       __currentHighlightedItemIndex = -1;
+       __currentPressedItemIndex = -1;
        __isInFocusMode = false;
 
        Invalidate();
index d7e8bfd..624b529 100644 (file)
@@ -49,7 +49,7 @@ _TabBarPresenter::_TabBarPresenter(_TabBar& tabBar)
        , __pFont(null)
        , __pTextObject(null)
        , __startPosition(FloatPoint(0.0f, 0.0f))
-       , __highlightedItemIndex(-1)
+       , __pressedItemIndex(-1)
        , __touchMoved(false)
        , __touchBubblingBlocked(true)
        , __topMargin(0.0f)
@@ -207,35 +207,41 @@ _TabBarPresenter::LoadBitmap(void)
 
        result r;
        r = GET_BITMAP_CONFIG_N(TABBAR::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
-       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap.");
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        __pBgBitmapCached = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetColor());
        delete pBitmap;
        pBitmap = null;
 
        r = GET_BITMAP_CONFIG_N(TABBAR::BG_OUTLINE_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgEffectBitmapCached);
-       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap.");
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = GET_BITMAP_CONFIG_N(TABBAR::LEFT_ARROW_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
        __pLeftArrowBitmapCached = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), arrowColor);
-       SysTryCatch(NID_UI_CTRL, __pLeftArrowBitmapCached != null, , E_OUT_OF_MEMORY, "Failed to load bitmap.");
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        delete pBitmap;
        pBitmap = null;
 
        r = GET_BITMAP_CONFIG_N(TABBAR::RIGHT_ARROW_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
        __pRightArrowBitmapCached = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), arrowColor);
-       SysTryCatch(NID_UI_CTRL, __pRightArrowBitmapCached != null, , E_OUT_OF_MEMORY, "Failed to load bitmap.");
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        delete pBitmap;
        pBitmap = null;
 
        r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
        __pItemBgBitmapCached[ITEM_STATUS_SELECTED] = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetItemColor(ITEM_STATUS_SELECTED));
-       SysTryCatch(NID_UI_CTRL, __pItemBgBitmapCached[ITEM_STATUS_SELECTED] != null, , E_OUT_OF_MEMORY, "Failed to load bitmap.");
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        delete pBitmap;
        pBitmap = null;
 
        r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
-       __pItemBgBitmapCached[ITEM_STATUS_HIGHLIGHTED] = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetItemColor(ITEM_STATUS_HIGHLIGHTED));
-       SysTryCatch(NID_UI_CTRL, __pItemBgBitmapCached[ITEM_STATUS_HIGHLIGHTED] != null, , E_OUT_OF_MEMORY, "Failed to load bitmap.");
+       __pItemBgBitmapCached[ITEM_STATUS_PRESSED] = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetItemColor(ITEM_STATUS_PRESSED));
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+       delete pBitmap;
+       pBitmap = null;
+
+       r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+       __pItemBgBitmapCached[ITEM_STATUS_DISABLED] = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetItemColor(ITEM_STATUS_DISABLED));
+       SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
        delete pBitmap;
        pBitmap = null;
 
@@ -565,7 +571,7 @@ _TabBarPresenter::SetItemReplacementColor(_TabBarItemStatus itemStatus, const Ti
                r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
                SysTryReturn(NID_UI_CTRL, pBitmap != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail.");
        }
-       else if (itemStatus == ITEM_STATUS_HIGHLIGHTED)
+       else if (itemStatus == ITEM_STATUS_PRESSED)
        {
                r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
                SysTryReturn(NID_UI_CTRL, pBitmap != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail.");
@@ -717,10 +723,21 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas)
 
                itemStatus = pDrawItem->GetStatus();
 
-               // draw item BG
-               if (__pItemBgBitmapCached[itemStatus] != null)
+               if (!__tabBar.IsEnabled())
                {
-                       pCanvas->DrawNinePatchedBitmap(itemBounds, *__pItemBgBitmapCached[itemStatus]);
+                       textColor = __tabBar.GetItemTextColor(ITEM_STATUS_DISABLED);
+                       if (__pItemBgBitmapCached[ITEM_STATUS_DISABLED] != null)
+                       {
+                               pCanvas->DrawNinePatchedBitmap(itemBounds, *__pItemBgBitmapCached[ITEM_STATUS_DISABLED]);
+                       }
+               }
+               else
+               {
+                       textColor = __tabBar.GetItemTextColor(itemStatus);
+                       if (__pItemBgBitmapCached[itemStatus] != null)
+                       {
+                               pCanvas->DrawNinePatchedBitmap(itemBounds, *__pItemBgBitmapCached[itemStatus]);
+                       }
                }
 
                // draw item text
@@ -746,15 +763,6 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas)
 
                __pTextObject->AppendElement(*pSimpleText);
 
-               if (!__tabBar.IsEnabled())
-               {
-                       textColor = __tabBar.GetItemTextColor(ITEM_STATUS_DISABLED);
-               }
-               else
-               {
-                       textColor = __tabBar.GetItemTextColor(itemStatus);
-               }
-
                __pTextObject->SetForegroundColor(textColor, 0, __pTextObject->GetTextLength());
                __pTextObject->SetBounds(textRect);
                __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
@@ -856,13 +864,13 @@ _TabBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touch
                return true;
        }
 
-       __highlightedItemIndex = index;
+       __pressedItemIndex = index;
        if (GetItemStatus(index) == ITEM_STATUS_SELECTED)
        {
                return true;
        }
 
-       result r = SetItemStatus(index, ITEM_STATUS_HIGHLIGHTED);
+       result r = SetItemStatus(index, ITEM_STATUS_PRESSED);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] propagating.", GetErrorMessage(r));
 
        Draw();
@@ -881,7 +889,7 @@ _TabBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touc
 
        if (index != -1 && GetItemStatus(index) != ITEM_STATUS_NORMAL && __touchMoved == false)
        {
-               if (GetItemStatus(index) == ITEM_STATUS_HIGHLIGHTED)
+               if (GetItemStatus(index) == ITEM_STATUS_PRESSED)
                {
                        r = SetItemStatus(index, ITEM_STATUS_SELECTED);
                        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] propagating.", GetErrorMessage(r));
@@ -893,14 +901,14 @@ _TabBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touc
 
        for (int i = 0; i < GetItemCount(); i++)
        {
-               if (GetItemStatus(i) == ITEM_STATUS_HIGHLIGHTED)
+               if (GetItemStatus(i) == ITEM_STATUS_PRESSED)
                {
                        r = SetItemStatus(i, ITEM_STATUS_NORMAL);
                        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] propagating.", GetErrorMessage(r));
                }
        }
 
-       __highlightedItemIndex = -1;
+       __pressedItemIndex = -1;
        __touchMoved = false;
 
        Draw();
@@ -915,14 +923,14 @@ _TabBarPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touc
 
        for (int i = 0; i < GetItemCount(); i++)
        {
-               if (GetItemStatus(i) == ITEM_STATUS_HIGHLIGHTED)
+               if (GetItemStatus(i) == ITEM_STATUS_PRESSED)
                {
                        r = SetItemStatus(i, ITEM_STATUS_NORMAL);
                        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] propagating.", GetErrorMessage(r));
                }
        }
 
-       __highlightedItemIndex = -1;
+       __pressedItemIndex = -1;
 
        Draw();
 
index 219bd3e..6cad661 100644 (file)
@@ -62,10 +62,11 @@ class _OSP_EXPORT_ _TabBar
        DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor);
        DECLARE_PROPERTY("normalItemColor", GetPropertyNormalItemColor, SetPropertyNormalItemColor);
        DECLARE_PROPERTY("selectedItemColor", GetPropertySelectedItemColor, SetPropertySelectedItemColor);
-       DECLARE_PROPERTY("highlightedItemColor", GetPropertyHighlightedItemColor, SetPropertyHighlightedItemColor);
+       DECLARE_PROPERTY("pressedItemColor", GetPropertyPressedItemColor, SetPropertyPressedItemColor);
+       DECLARE_PROPERTY("disabledItemColor", GetPropertyDisabledItemColor, SetPropertyDisabledItemColor);
        DECLARE_PROPERTY("normalItemTextColor", GetPropertyNormalItemTextColor, SetPropertyNormalItemTextColor);
        DECLARE_PROPERTY("selectedItemTextColor", GetPropertySelectedItemTextColor, SetPropertySelectedItemTextColor);
-       DECLARE_PROPERTY("highlightedItemTextColor", GetPropertyHighlightedItemTextColor, SetPropertyHighlightedItemTextColor);
+       DECLARE_PROPERTY("pressedItemTextColor", GetPropertyPressedItemTextColor, SetPropertyPressedItemTextColor);
        DECLARE_PROPERTY("disabledItemTextColor", GetPropertyDisabledItemTextColor, SetPropertyDisabledItemTextColor);
        DECLARE_CLASS_END();
 
@@ -79,8 +80,11 @@ class _OSP_EXPORT_ _TabBar
        result SetPropertySelectedItemColor(const Variant& color);
        Variant GetPropertySelectedItemColor(void) const;
 
-       result SetPropertyHighlightedItemColor(const Variant& color);
-       Variant GetPropertyHighlightedItemColor(void) const;
+       result SetPropertyPressedItemColor(const Variant& color);
+       Variant GetPropertyPressedItemColor(void) const;
+
+       result SetPropertyDisabledItemColor(const Variant& color);
+       Variant GetPropertyDisabledItemColor(void) const;
 
        result SetPropertyNormalItemTextColor(const Variant& color);
        Variant GetPropertyNormalItemTextColor(void) const;
@@ -88,8 +92,8 @@ class _OSP_EXPORT_ _TabBar
        result SetPropertySelectedItemTextColor(const Variant& color);
        Variant GetPropertySelectedItemTextColor(void) const;
 
-       result SetPropertyHighlightedItemTextColor(const Variant& color);
-       Variant GetPropertyHighlightedItemTextColor(void) const;
+       result SetPropertyPressedItemTextColor(const Variant& color);
+       Variant GetPropertyPressedItemTextColor(void) const;
 
        result SetPropertyDisabledItemTextColor(const Variant& color);
        Variant GetPropertyDisabledItemTextColor(void) const;
@@ -178,7 +182,7 @@ private:
        _TabBarPresenter* __pTabBarPresenter;
 
        bool __isInFocusMode;
-       int __currentHighlightedItemIndex;
+       int __currentPressedItemIndex;
        _ActionEvent* __pActionEvent;
 
        Tizen::Graphics::Color __color;
index 5b1f6d6..77cb1a1 100644 (file)
@@ -41,7 +41,7 @@ enum _TabBarItemStatus
 {
        ITEM_STATUS_NORMAL = 0,
        ITEM_STATUS_SELECTED,
-       ITEM_STATUS_HIGHLIGHTED,
+       ITEM_STATUS_PRESSED,
        ITEM_STATUS_DISABLED,
        ITEM_STATUS_MAX
 };
index a2b1bcd..810549f 100644 (file)
@@ -133,7 +133,7 @@ private:
        Tizen::Graphics::Font* __pFont;
        Tizen::Graphics::_Text::TextObject* __pTextObject;
        Tizen::Graphics::FloatPoint __startPosition;
-       int __highlightedItemIndex;
+       int __pressedItemIndex;
        bool __touchMoved;
        bool __touchBubblingBlocked;
 
index 1bd852a..734c9b9 100644 (file)
@@ -41,6 +41,7 @@ DECLARE_UI_CONFIG(TABBAR);
        DECLARE_IMAGE_CONFIG(ITEM_BG_NORMAL, 5);
        DECLARE_IMAGE_CONFIG(ITEM_BG_PRESSED, 6);
        DECLARE_IMAGE_CONFIG(ITEM_BG_SELECTED, 7);
+       DECLARE_IMAGE_CONFIG(ITEM_BG_DISABLED, 8);
        DECLARE_SHAPE_CONFIG(FONT_SIZE, 1);
        DECLARE_SHAPE_CONFIG(FONT_MARGIN, 2);
        DECLARE_SHAPE_CONFIG(TOP_MARGIN, 3);
index 38be261..73eafd8 100644 (file)
@@ -1984,6 +1984,10 @@ ConfigParser::GetImageKeyTable(void)
                        __pImageKeyTable->Add(ResourceKey(key), _TABBAR::ITEM_BG_SELECTED_IMAGE);
                }
                {
+                       const char* key ="TABBAR::ITEM_BG_DISABLED";
+                       __pImageKeyTable->Add(ResourceKey(key), _TABBAR::ITEM_BG_DISABLED_IMAGE);
+               }
+               {
                        const char* key ="TAB::VERTICAL_DIVIDER_NORMAL";
                        __pImageKeyTable->Add(ResourceKey(key), _TAB::VERTICAL_DIVIDER_NORMAL_IMAGE);
                }
index d532a33..dbc8cab 100644 (file)
@@ -41,6 +41,7 @@ START_UI_CONFIG(TABBAR);
        ADD_IMAGE_CONFIG(ITEM_BG_NORMAL, #00_category_button.#.png);
        ADD_IMAGE_CONFIG(ITEM_BG_PRESSED, #00_category_button_focus.#.png);
        ADD_IMAGE_CONFIG(ITEM_BG_SELECTED, #00_category_button.#.png);
+       ADD_IMAGE_CONFIG(ITEM_BG_DISABLED, #00_category_button.#.png);
 
        START_UI_CONFIG_MODE(480x800);
        END_UI_CONFIG_MODE(480x800);