Modified to apply a custom color of the item divider
authoryouseong.ji <youseong.ji@samsung.com>
Wed, 24 Apr 2013 09:01:26 +0000 (18:01 +0900)
committeryouseong.ji <youseong.ji@samsung.com>
Wed, 24 Apr 2013 10:31:18 +0000 (19:31 +0900)
Change-Id: Ic6e4f9b20fbf4c6d78f7499e6f8b378e9ebe6058
Signed-off-by: youseong.ji <youseong.ji@samsung.com>
src/ui/controls/FUiCtrl_TableView.cpp
src/ui/controls/FUiCtrl_TableViewItem.cpp
src/ui/inc/FUiCtrl_TableViewItem.h

index 85d57c8..437d62e 100644 (file)
@@ -834,7 +834,7 @@ _TableView::SetPropertyItemDividerColor(const Variant& itemDividerColor)
 {
        __itemDividerColor = itemDividerColor.ToColor();
 
-       return E_SUCCESS;
+       return __pTableViewPresenter->SetStatusChanged(true);
 }
 
 result
index 6cadb9c..2b15835 100644 (file)
@@ -3068,8 +3068,9 @@ _TableViewItem::DrawItemDivider(void)
 
        FloatRectangle dividerBottomBounds;
        FloatRectangle dividerTopBounds;
-       Color dividerColor;
-       Color underLineColor;
+       Color topLineColor;
+       Color bottomLineColor;
+       Color customDividerColor;
        FloatRectangle bounds;
        FloatPoint bottomPoint;
 
@@ -3105,11 +3106,11 @@ _TableViewItem::DrawItemDivider(void)
 
                        if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
                        {
-                               GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_NORMAL, underLineColor);
+                               GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_NORMAL, bottomLineColor);
                        }
                        else
                        {
-                               GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_PRESSED, underLineColor);
+                               GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_PRESSED, bottomLineColor);
                        }
 
                        GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight);
@@ -3139,10 +3140,11 @@ _TableViewItem::DrawItemDivider(void)
                        }
                }
 
-               GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL, dividerColor);
+               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::GROUPITEM_INDEX_BAR_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin);
                GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight);
-               underLineColor = __pDrawingProperty->dividerColor;
 
                lineHeight = Tizen::Graphics::CoordinateSystem::ConvertToLogicalY(lineHeight);
                bottomPoint = Tizen::Graphics::CoordinateSystem::AlignToDevice(FloatPoint(lineLeftMargin, (bounds.height)));
@@ -3162,7 +3164,16 @@ _TableViewItem::DrawItemDivider(void)
                        if(__pItemDivider->GetVisibleState())
                        {
                                __pItemDivider->SetBounds(dividerBottomBounds);
-                               __pItemDivider->SetBackgroundColor(underLineColor);
+                               if(customDividerColor == bottomLineColor || __itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
+                               {
+                                       __pItemDivider->SetBackgroundColor(bottomLineColor);
+                               }
+                               else
+                               {
+                                       __pItemDivider->SetBackgroundColor(customDividerColor);
+                                       __pItemDivider->GetVisualElement()->SetOpacity(ITEM_BOTTOM_DIVIDER_OPACITY);
+                               }
+
                                __pItemDivider->Invalidate();
                        }
                }
@@ -3173,7 +3184,15 @@ _TableViewItem::DrawItemDivider(void)
                if(__pItemTopDivider->GetVisibleState())
                {
                        __pItemTopDivider->SetBounds(dividerTopBounds);
-                       __pItemTopDivider->SetBackgroundColor(dividerColor);
+                       if(customDividerColor == bottomLineColor)
+                       {
+                               __pItemTopDivider->SetBackgroundColor(topLineColor);
+                       }
+                       else
+                       {
+                               __pItemTopDivider->SetBackgroundColor(customDividerColor);
+                               __pItemTopDivider->GetVisualElement()->SetOpacity(ITEM_TOP_DIVIDER_OPACITY);
+                       }
                        __pItemTopDivider->Invalidate();
                }
        }
index 211359c..6ee39af 100644 (file)
@@ -457,6 +457,8 @@ private:
        static const int MAX_CHECKED_COUNT = 10;
        static const float INSENSITIVE = 0.16f;
        static const float SENSITIVE = 0.08f;
+       static const float ITEM_TOP_DIVIDER_OPACITY = 0.3f;
+       static const float ITEM_BOTTOM_DIVIDER_OPACITY = 1.0f;
 };
 
 }}} // Tizen::Ui::Controls