From 92c779bd11ec2472f52b4d82798cb7df2c260397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 6 Jan 2008 19:02:00 +0000 Subject: [PATCH] patch by Alexandre Deckner (aldeck): * improve the placement of text in the shutdown window * define constants for the width of the "stripe" and icon size Thanks! Fixes #1697. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23270 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/ShutdownProcess.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 169278d0ec..74c226f344 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -61,6 +61,9 @@ static const bigtime_t kNonAppQuitTimeout = 500000; // 0.5 s // the shutdown window before closing it automatically. static const bigtime_t kDisplayAbortingAppTimeout = 3000000; // 3 s +static const int kStripeWidth = 30; +static const int kIconVSpacing = 6; +static const int kIconSize = 32; // message what fields (must not clobber the registrar's message namespace) enum { @@ -248,7 +251,7 @@ public: // create the views // root view - fRootView = new(nothrow) TAlertView(BRect(0, 0, 100, 15), "app icons", + fRootView = new(nothrow) TAlertView(BRect(0, 0, 10, 10), "app icons", B_FOLLOW_NONE, 0); if (!fRootView) return B_NO_MEMORY; @@ -351,8 +354,7 @@ public: fTextView->SetText("two\nlines"); int textHeight = (int)fTextView->TextHeight(0, 1) + 1; - int rightPartX = fRootView->Frame().IntegerWidth() - + 1; + int rightPartX = kStripeWidth + kIconSize / 2 + 1; int textX = rightPartX + kInnerHSpacing; int textY = kVSpacing; int buttonsY = textY + textHeight + kInnerVSpacing; @@ -533,7 +535,7 @@ private: virtual void Draw(BRect updateRect) { BRect stripeRect = Bounds(); - stripeRect.right = 30; + stripeRect.right = kStripeWidth; SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); FillRect(stripeRect); @@ -544,7 +546,8 @@ private: } else SetDrawingMode(B_OP_OVER); - DrawBitmapAsync(fAppInfo->largeIcon, BPoint(18, 6)); + DrawBitmapAsync(fAppInfo->largeIcon, + BPoint(kStripeWidth - kIconSize / 2, kIconVSpacing)); } }