Modified logic of simpleitemcontents's child layout.
authoryouseong.ji <youseong.ji@samsung.com>
Thu, 27 Jun 2013 01:36:42 +0000 (18:36 -0700)
committeryouseong.ji <youseong.ji@samsung.com>
Thu, 27 Jun 2013 09:15:31 +0000 (18:15 +0900)
Change-Id: Ib115284cee735be1e6ede6e14facf70891d82a90
Signed-off-by: youseong.ji <youseong.ji@samsung.com>
src/ui/controls/FUiCtrl_TableViewItem.cpp

index 7b78429..90f50c5 100644 (file)
@@ -1638,7 +1638,9 @@ _TableViewItem::OnChildAttached(const _Control& child)
 
        if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO))
        {
-               if (GetLabelCore(__pItemAnnex) == &child)
+               if (GetLabelCore(__pItemAnnex) == &child ||
+                       GetLabelCore(__pSimpleItemBitmap) == &child ||
+                       GetLabelCore(__pSimpleItemText) == &child)
                {
                        return;
                }
@@ -3502,7 +3504,8 @@ _TableViewItem::SetSimpleItemContents(const Tizen::Base::String& text, const Tiz
        float annexMargin = 0.0f;
        float elementWidth = 0;
        float elementHeight = 0;
-       float itemHeight = __itemHeight;
+       float itemHeight = GetBoundsF().height;
+       float itemWidth = GetBoundsF().width;
        float annexWidth = GetAnnexWidth(__annexStyle);
 
        if (groupType)
@@ -3533,25 +3536,29 @@ _TableViewItem::SetSimpleItemContents(const Tizen::Base::String& text, const Tiz
                bitmapRect.height = elementHeight;
        }
 
-       textRect.x = bitmapRect.x + elementWidth + leftMargin;
-
-       if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || __annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
-       {
-               GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin);
-               textRect.x = bitmapRect.x + elementWidth + annexMargin;
-       }
-
-       if (annexWidth > 0) // +++ check floating
+       if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_NORMAL)
        {
-               elementWidth = __itemWidth - textRect.x - annexWidth - leftMargin;
+               textRect.x = bitmapRect.x + elementWidth + leftMargin;
+               elementWidth = itemWidth - textRect.x - leftMargin;
        }
        else
        {
-               elementWidth = __itemWidth - textRect.x;
+               GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin);
+               if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || __annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
+               {
+                       bitmapRect.x = leftMargin + annexWidth + annexMargin;
+                       textRect.x = bitmapRect.x + elementWidth + leftMargin;
+                       elementWidth = itemWidth - textRect.x - leftMargin;
+               }
+               else
+               {
+                       textRect.x = bitmapRect.x + elementWidth + leftMargin;
+                       elementWidth = itemWidth - textRect.x - annexWidth - leftMargin - annexMargin;
+               }
        }
 
        textRect.y = 0.0f;
-       textRect.width = elementWidth;
+       textRect.width = elementWidth < 0 ? 0 : elementWidth;;
        textRect.height = itemHeight;
 
        if (__pSimpleItemBitmap != null && pBitmap != null)