From: youseong.ji Date: Wed, 24 Apr 2013 09:01:26 +0000 (+0900) Subject: Modified to apply a custom color of the item divider X-Git-Tag: accepted/tizen_2.1/20130426.150533~16^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a94faf63aa42179eb6e05c2006a242d9203c9ffa;p=platform%2Fframework%2Fnative%2Fuifw.git Modified to apply a custom color of the item divider Change-Id: Ic6e4f9b20fbf4c6d78f7499e6f8b378e9ebe6058 Signed-off-by: youseong.ji --- diff --git a/src/ui/controls/FUiCtrl_TableView.cpp b/src/ui/controls/FUiCtrl_TableView.cpp index 85d57c8..437d62e 100644 --- a/src/ui/controls/FUiCtrl_TableView.cpp +++ b/src/ui/controls/FUiCtrl_TableView.cpp @@ -834,7 +834,7 @@ _TableView::SetPropertyItemDividerColor(const Variant& itemDividerColor) { __itemDividerColor = itemDividerColor.ToColor(); - return E_SUCCESS; + return __pTableViewPresenter->SetStatusChanged(true); } result diff --git a/src/ui/controls/FUiCtrl_TableViewItem.cpp b/src/ui/controls/FUiCtrl_TableViewItem.cpp index 6cadb9c..2b15835 100644 --- a/src/ui/controls/FUiCtrl_TableViewItem.cpp +++ b/src/ui/controls/FUiCtrl_TableViewItem.cpp @@ -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(); } } diff --git a/src/ui/inc/FUiCtrl_TableViewItem.h b/src/ui/inc/FUiCtrl_TableViewItem.h index 211359c..6ee39af 100644 --- a/src/ui/inc/FUiCtrl_TableViewItem.h +++ b/src/ui/inc/FUiCtrl_TableViewItem.h @@ -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