Author: pulkomandy Date: 2011-09-05 22:20:36 +0200 (Mon, 05 Sep 2011) New Revision: 42716 Changeset: https://dev.haiku-os.org/changeset/42716 Modified: haiku/trunk/src/servers/notification/NotificationView.cpp Log: 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 ? Modified: haiku/trunk/src/servers/notification/NotificationView.cpp =================================================================== --- haiku/trunk/src/servers/notification/NotificationView.cpp 2011-09-05 10:49:32 UTC (rev 42715) +++ haiku/trunk/src/servers/notification/NotificationView.cpp 2011-09-05 20:20:36 UTC (rev 42716) @@ -15,6 +15,7 @@ #include <stdlib.h> +#include <ControlLook.h> #include <Font.h> #include <IconUtils.h> #include <Messenger.h> @@ -104,8 +105,8 @@ 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 @@ // 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 @@ 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 @@ 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);