ListView: computate disabled color only for disabled items.

This commit is contained in:
Adrien Destugues
2014-12-11 10:39:51 +01:00
parent e3686c1bd2
commit 94d14479bb
+8 -8
View File
@@ -1723,16 +1723,16 @@ BListView::_CalcLastSelected(int32 before)
void
BListView::DrawItem(BListItem* item, BRect itemRect, bool complete)
{
rgb_color textColor = ui_color(B_LIST_ITEM_TEXT_COLOR);
rgb_color disabledColor;
if (textColor.red + textColor.green + textColor.blue > 128 * 3)
disabledColor = tint_color(textColor, B_DARKEN_2_TINT);
else
disabledColor = tint_color(textColor, B_LIGHTEN_2_TINT);
if (!item->IsEnabled()) {
rgb_color textColor = ui_color(B_LIST_ITEM_TEXT_COLOR);
rgb_color disabledColor;
if (textColor.red + textColor.green + textColor.blue > 128 * 3)
disabledColor = tint_color(textColor, B_DARKEN_2_TINT);
else
disabledColor = tint_color(textColor, B_LIGHTEN_2_TINT);
if (!item->IsEnabled())
SetHighColor(disabledColor);
else if (item->IsSelected())
} else if (item->IsSelected())
SetHighColor(ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR));
else
SetHighColor(ui_color(B_LIST_ITEM_TEXT_COLOR));