Applying AnnexDividerChanges and making itemDividerLeftMargin as fixedConfig
authorVinay Dutt Vyas <vinay.vyas@samsung.com>
Tue, 9 Jul 2013 13:26:09 +0000 (18:56 +0530)
committerVinay Dutt Vyas <vinay.vyas@samsung.com>
Wed, 10 Jul 2013 05:35:31 +0000 (11:05 +0530)
Change-Id: Ia1fbc2323b2603c951cb32f64f5307b1ef4cef08

src/ui/controls/FUiCtrl_TableViewItem.cpp
src/ui/inc/FUiCtrl_TableViewItem.h
src/ui/inc/FUi_ResourceTableViewConfig.h
src/ui/resource/FUi_ResourceTableViewConfig.cpp

index 58fd43d..3af8ab4 100644 (file)
@@ -3289,14 +3289,15 @@ _TableViewItem::DrawItemDivider(void)
                customDividerColor = __pDrawingProperty->dividerColor;
                GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL, topLineColor);
                GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_BOTTOM_BG_NORMAL, bottomLineColor);
-               GET_SHAPE_CONFIG(TABLEVIEW::ITEM_DIVIDER_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin);
+               GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin);
                GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight);
 
+               lineLeftMargin = Tizen::Graphics::CoordinateSystem::ConvertToLogicalX(lineLeftMargin);
                lineHeight = Tizen::Graphics::CoordinateSystem::ConvertToLogicalY(lineHeight);
                bottomPoint = Tizen::Graphics::CoordinateSystem::AlignToDevice(FloatPoint(lineLeftMargin, (bounds.height)));
 
-               dividerTopBounds.SetBounds(bottomPoint.x, 0.0f, bounds.width - lineLeftMargin * 2.0f, lineHeight);
-               dividerBottomBounds.SetBounds(bottomPoint.x, bottomPoint.y - lineHeight, bounds.width - lineLeftMargin * 2.0f, lineHeight);
+               dividerTopBounds.SetBounds(lineLeftMargin, 0.0f, bounds.width - lineLeftMargin * 2.0f, lineHeight);
+               dividerBottomBounds.SetBounds(lineLeftMargin, bottomPoint.y - lineHeight, bounds.width - lineLeftMargin * 2.0f, lineHeight);
        }
 
        if(__pItemDivider->GetVisibleState())
@@ -3349,6 +3350,8 @@ _TableViewItem::DrawItemAnnexDivider(void)
        {
                Color dividerLeftColor;
                Color dividerRightColor;
+               Color customDividerColor;
+               Color bottomLineColor;
                FloatRectangle bounds = GetBoundsF();
                float dividerHeight = 0;
                float itemHeight = 0;
@@ -3358,11 +3361,13 @@ _TableViewItem::DrawItemAnnexDivider(void)
                float annexLeftMargin = 0.0f;
                float itemLeftMargin = 0.0f;
 
+               customDividerColor = __pDrawingProperty->dividerColor;
                GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemLeftMargin);
                GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexLeftMargin);
                GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
                GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_LEFT_BG_NORMAL, dividerLeftColor);
                GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_RIGHT_BG_NORMAL, dividerRightColor);
+               GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_BOTTOM_BG_NORMAL, bottomLineColor);
                GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, dividerWidth);
                GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerTopMargin);
 
@@ -3371,13 +3376,30 @@ _TableViewItem::DrawItemAnnexDivider(void)
                dividerHeight = itemHeight - (dividerTopMargin*2);
                dividerHeight = (dividerHeight > 0) ? dividerHeight : 0;
                __pItemAnnexLeftDivider->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - (itemLeftMargin + annexLeftMargin) - (dividerWidth*2)), dividerTopMargin, dividerWidth, dividerHeight));
-               __pItemAnnexLeftDivider->SetBackgroundColor(dividerLeftColor);
-               __pItemAnnexLeftDivider->Invalidate();
-
                __pItemAnnexRightDivider->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - (itemLeftMargin + annexLeftMargin) - dividerWidth), dividerTopMargin, dividerWidth, dividerHeight));
-               __pItemAnnexRightDivider->SetBackgroundColor(dividerRightColor);
-               __pItemAnnexRightDivider->Invalidate();
 
+               if (customDividerColor == bottomLineColor)
+               {
+                       __pItemAnnexLeftDivider->SetBackgroundColor(dividerLeftColor);
+               }
+               else
+               {
+                       __pItemAnnexLeftDivider->SetBackgroundColor(customDividerColor);
+                       __pItemAnnexLeftDivider->GetVisualElement()->SetOpacity(ITEM_TOP_DIVIDER_OPACITY);
+               }
+
+               if (customDividerColor == bottomLineColor)
+               {
+                       __pItemAnnexRightDivider->SetBackgroundColor(dividerRightColor);
+               }
+               else
+               {
+                       __pItemAnnexRightDivider->SetBackgroundColor(customDividerColor);
+                       __pItemAnnexRightDivider->GetVisualElement()->SetOpacity(ITEM_BOTTOM_DIVIDER_OPACITY);
+               }
+
+               __pItemAnnexLeftDivider->Invalidate();
+               __pItemAnnexRightDivider->Invalidate();
        }
 
        if (__pItemAnnexLeftDivider != null)
index 6735e39..b7a1be6 100644 (file)
@@ -486,7 +486,6 @@ private:
        static const float SENSITIVE = 0.08f;
        static const float ITEM_TOP_DIVIDER_OPACITY = 0.3f;
        static const float ITEM_BOTTOM_DIVIDER_OPACITY = 1.0f;
-       static const float ITEM_ANNEX_DIVIDER_OPACITY = 0.2f;
 };
 
 }}} // Tizen::Ui::Controls
index e376be8..70c99e2 100644 (file)
@@ -155,11 +155,11 @@ DECLARE_UI_CONFIG(TABLEVIEW);
        DECLARE_SHAPE_CONFIG(GROUPITEM_INDEX_BAR_LEFT_MARGIN, 19);
        DECLARE_SHAPE_CONFIG(GROUPITEM_INDEX_BAR_BOTTOM_MARGIN, 20);
        DECLARE_SHAPE_CONFIG(FASTSCROLL_INDEX_WIDTH, 21);
-       DECLARE_SHAPE_CONFIG(ITEM_DIVIDER_LEFT_MARGIN,22);
        DECLARE_FIXED_VALUE_CONFIG(ITEM_DIVIDER_HEIGHT, 1);
        DECLARE_FIXED_VALUE_CONFIG(SECTIONITEM_TOP_MARGIN, 2);
        DECLARE_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_WIDTH, 3);
        DECLARE_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_MARGIN, 4);
+       DECLARE_FIXED_VALUE_CONFIG(ITEM_DIVIDER_LEFT_MARGIN, 5);
 DECLARE_END_UI_CONFIG(TABLEVIEW);
 
 #endif //_FUI_RESOURCE_TABLE_VIEW_CONFIG_H_
index 08190a6..247448b 100644 (file)
@@ -149,11 +149,11 @@ START_UI_CONFIG(TABLEVIEW);
                ADD_SHAPE_CONFIG(GROUPITEM_INDEX_BAR_LEFT_MARGIN, 0);
                ADD_SHAPE_CONFIG(GROUPITEM_INDEX_BAR_BOTTOM_MARGIN, 14);
                ADD_SHAPE_CONFIG(FASTSCROLL_INDEX_WIDTH, 51);
-               ADD_SHAPE_CONFIG(ITEM_DIVIDER_LEFT_MARGIN, 2);
                ADD_FIXED_VALUE_CONFIG(ITEM_DIVIDER_HEIGHT, 1);
                ADD_FIXED_VALUE_CONFIG(SECTIONITEM_TOP_MARGIN, 0);
                ADD_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_WIDTH, 1);
                ADD_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_MARGIN, 30);
+               ADD_FIXED_VALUE_CONFIG(ITEM_DIVIDER_LEFT_MARGIN, 2);
        END_UI_CONFIG_MODE(720x1280);
 }
 END_UI_CONFIG(TABLEVIEW);