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:
@@ -72,14 +72,15 @@ NotificationView::NotificationView(NotificationWindow* win,
|
|||||||
BGroupLayout* layout = new BGroupLayout(B_VERTICAL);
|
BGroupLayout* layout = new BGroupLayout(B_VERTICAL);
|
||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
|
|
||||||
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
switch (fNotification->Type()) {
|
switch (fNotification->Type()) {
|
||||||
case B_IMPORTANT_NOTIFICATION:
|
case B_IMPORTANT_NOTIFICATION:
|
||||||
SetViewColor(255, 255, 255);
|
fStripeColor = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
|
||||||
SetLowColor(255, 255, 255);
|
|
||||||
break;
|
break;
|
||||||
case B_ERROR_NOTIFICATION:
|
case B_ERROR_NOTIFICATION:
|
||||||
SetViewColor(ui_color(B_FAILURE_COLOR));
|
fStripeColor = ui_color(B_FAILURE_COLOR);
|
||||||
SetLowColor(ui_color(B_FAILURE_COLOR));
|
|
||||||
break;
|
break;
|
||||||
case B_PROGRESS_NOTIFICATION:
|
case B_PROGRESS_NOTIFICATION:
|
||||||
{
|
{
|
||||||
@@ -94,10 +95,11 @@ NotificationView::NotificationView(NotificationWindow* win,
|
|||||||
|
|
||||||
layout->AddView(progress);
|
layout->AddView(progress);
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through.
|
||||||
default:
|
case B_INFORMATION_NOTIFICATION:
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fStripeColor = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
B_DARKEN_1_TINT);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetText();
|
SetText();
|
||||||
@@ -239,7 +241,7 @@ NotificationView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
BRect stripeRect = Bounds();
|
BRect stripeRect = Bounds();
|
||||||
stripeRect.right = kIconStripeWidth;
|
stripeRect.right = kIconStripeWidth;
|
||||||
SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT));
|
SetHighColor(fStripeColor);
|
||||||
FillRect(stripeRect);
|
FillRect(stripeRect);
|
||||||
|
|
||||||
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
||||||
|
|||||||
Reference in New Issue
Block a user