From 5414f4dceb079bb6d75b1ffb39fb3320caae4fc4 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 5 Sep 2011 20:20:36 +0000 Subject: [PATCH] More tweaking ofthe element positions in notification view : * Progress bar is 8 pixels away fom bottom, right, and icon stripe * Icon is horizontally positionned like in BAlert * Move text a bit more to the right Thanks to diver for the great suggestion mockups. Note : some of the settings in Notification preflet are now ignored ("title above icon" comes to mind). I think they don't make much sense anyway, anyone cares if they get removed ? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42716 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/notification/NotificationView.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/servers/notification/NotificationView.cpp b/src/servers/notification/NotificationView.cpp index 601f2b939b..215b1e1958 100644 --- a/src/servers/notification/NotificationView.cpp +++ b/src/servers/notification/NotificationView.cpp @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -104,8 +105,8 @@ NotificationView::NotificationView(NotificationWindow* win, break; case B_PROGRESS_NOTIFICATION: { - BRect frame(kIconStripeWidth * 3, Bounds().bottom - 36, - Bounds().right - kEdgePadding, Bounds().bottom - kEdgePadding); + BRect frame(kIconStripeWidth + 8, Bounds().bottom - 36, + Bounds().right - 8, Bounds().bottom - 8); BStatusBar* progress = new BStatusBar(frame, "progress"); progress->SetBarHeight(12.0f); progress->SetMaxValue(1.0f); @@ -290,9 +291,8 @@ NotificationView::Draw(BRect updateRect) // Draw icon if (fBitmap) { - float ix = kIconStripeWidth - iconSize / 3.0; - // Icon is centered around stripe right border - float iy = (Bounds().Height() - iconSize) / 2.0; + float ix = 18; + float iy = (Bounds().Height() - iconSize) / 4.0; // Icon is vertically centered in view if (fType == B_PROGRESS_NOTIFICATION) @@ -331,6 +331,11 @@ NotificationView::Draw(BRect updateRect) StrokeLine(closeCross.LeftBottom(), closeCross.RightTop()); PopState(); + SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); + BPoint left(Bounds().left, Bounds().bottom - 1); + BPoint right(Bounds().right, Bounds().bottom - 1); + StrokeLine(left, right); + Sync(); } @@ -482,9 +487,9 @@ NotificationView::SetText(const char* app, const char* title, const char* text, float iconRight = kIconStripeWidth; if (fBitmap != NULL) - iconRight += fParent->IconSize() * 0.75; + iconRight += fParent->IconSize(); else - iconRight += 24; + iconRight += 32; font_height fh; be_bold_font->GetHeight(&fh);