Teammonitor: Respect system colors
Change-Id: I5cc69376ade425c46bc76f8179f93bb74428da68 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3261 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
0b07cea059
commit
4b1f514b08
@@ -66,26 +66,23 @@ TeamListItem::CacheLocalizedName()
|
|||||||
void
|
void
|
||||||
TeamListItem::DrawItem(BView* owner, BRect frame, bool complete)
|
TeamListItem::DrawItem(BView* owner, BRect frame, bool complete)
|
||||||
{
|
{
|
||||||
rgb_color kHighlight = { 140, 140, 140, 0 };
|
rgb_color kHighlight = ui_color(B_LIST_SELECTED_BACKGROUND_COLOR);
|
||||||
rgb_color kBlack = { 0, 0, 0, 0 };
|
rgb_color kHighlightText = ui_color(B_LIST_SELECTED_ITEM_TEXT_COLOR);
|
||||||
rgb_color kBlue = { 0, 0, 255, 0 };
|
rgb_color kText = ui_color(B_LIST_ITEM_TEXT_COLOR);
|
||||||
rgb_color kRed = { 255, 0, 0, 0 };
|
|
||||||
|
rgb_color kIdealRed = { 255, 0, 0, 0 };
|
||||||
|
rgb_color kIdealBlue = { 0, 0, 255, 0 };
|
||||||
|
rgb_color kRed = mix_color(kIdealRed, kText, 191);
|
||||||
|
rgb_color kBlue = mix_color(kIdealBlue, kText, 191);
|
||||||
|
rgb_color kHighlightRed = mix_color(kIdealRed, kHighlightText, 191);
|
||||||
|
rgb_color kHighlightBlue = mix_color(kIdealBlue, kHighlightText, 191);
|
||||||
|
|
||||||
BRect r(frame);
|
BRect r(frame);
|
||||||
|
|
||||||
if (IsSelected() || complete) {
|
if (IsSelected() || complete) {
|
||||||
rgb_color color;
|
owner->SetHighColor(kHighlight);
|
||||||
if (IsSelected())
|
owner->SetLowColor(kHighlight);
|
||||||
color = kHighlight;
|
|
||||||
else
|
|
||||||
color = owner->ViewColor();
|
|
||||||
|
|
||||||
owner->SetHighColor(color);
|
|
||||||
owner->SetLowColor(color);
|
|
||||||
owner->FillRect(r);
|
owner->FillRect(r);
|
||||||
owner->SetHighColor(kBlack);
|
|
||||||
} else {
|
|
||||||
owner->SetLowColor(owner->ViewColor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
frame.left += 4;
|
frame.left += 4;
|
||||||
@@ -99,10 +96,13 @@ TeamListItem::DrawItem(BView* owner, BRect frame, bool complete)
|
|||||||
|
|
||||||
frame.left += 16;
|
frame.left += 16;
|
||||||
if (fRefusingToQuit)
|
if (fRefusingToQuit)
|
||||||
owner->SetHighColor(kRed);
|
owner->SetHighColor(IsSelected() ? kHighlightRed : kRed);
|
||||||
|
else {
|
||||||
|
if (IsSystemServer())
|
||||||
|
owner->SetHighColor(IsSelected() ? kHighlightBlue : kBlue);
|
||||||
else
|
else
|
||||||
owner->SetHighColor(IsSystemServer() ? kBlue : kBlack);
|
owner->SetHighColor(IsSelected() ? kHighlightText : kText);
|
||||||
|
}
|
||||||
BFont font = be_plain_font;
|
BFont font = be_plain_font;
|
||||||
font_height finfo;
|
font_height finfo;
|
||||||
font.GetHeight(&finfo);
|
font.GetHeight(&finfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user