Notifications: only color the left stripe

* Setting the important/failure color on the whole view looked ugly.
* Important notifications use B_CONTROL_HIGHLIGHT_COLOR, instead of
white.
* We may want to select better success and failure colors. Pure red and
green don't look very good. Suggestions welcome.
This commit is contained in:
Adrien Destugues
2014-04-22 13:46:46 +02:00
parent 567a96acc9
commit 48d90a5092
+11 -9
View File
@@ -72,14 +72,15 @@ NotificationView::NotificationView(NotificationWindow* win,
BGroupLayout* layout = new BGroupLayout(B_VERTICAL);
SetLayout(layout);
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
switch (fNotification->Type()) {
case B_IMPORTANT_NOTIFICATION:
SetViewColor(255, 255, 255);
SetLowColor(255, 255, 255);
fStripeColor = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
break;
case B_ERROR_NOTIFICATION:
SetViewColor(ui_color(B_FAILURE_COLOR));
SetLowColor(ui_color(B_FAILURE_COLOR));
fStripeColor = ui_color(B_FAILURE_COLOR);
break;
case B_PROGRESS_NOTIFICATION:
{
@@ -94,10 +95,11 @@ NotificationView::NotificationView(NotificationWindow* win,
layout->AddView(progress);
}
// fall through
default:
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// fall through.
case B_INFORMATION_NOTIFICATION:
fStripeColor = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
B_DARKEN_1_TINT);
break;
}
SetText();
@@ -239,7 +241,7 @@ NotificationView::Draw(BRect updateRect)
BRect stripeRect = Bounds();
stripeRect.right = kIconStripeWidth;
SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT));
SetHighColor(fStripeColor);
FillRect(stripeRect);
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));