[haiku-commits] haiku: hrev47154 - src/servers/notification

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 22 Apr 2014 13:47:39 +0200 (CEST)

hrev47154 adds 1 changeset to branch 'master'
old head: 567a96acc9bd203a0cddff34387a73d50fcbc509
new head: 48d90a5092336ffef54e5229469b4aab73ca29ed
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=48d90a5+%5E567a96a

----------------------------------------------------------------------------

48d90a5: 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.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47154
Commit:      48d90a5092336ffef54e5229469b4aab73ca29ed
URL:         http://cgit.haiku-os.org/haiku/commit/?id=48d90a5
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Tue Apr 22 11:44:02 2014 UTC

----------------------------------------------------------------------------

1 file changed, 11 insertions(+), 9 deletions(-)
src/servers/notification/NotificationView.cpp | 20 +++++++++++---------

----------------------------------------------------------------------------

diff --git a/src/servers/notification/NotificationView.cpp 
b/src/servers/notification/NotificationView.cpp
index b88e5de..0ab0dad 100644
--- a/src/servers/notification/NotificationView.cpp
+++ b/src/servers/notification/NotificationView.cpp
@@ -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));


Other related posts: