[haiku-commits] haiku: hrev45528 - src/apps/stylededit

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 20 Apr 2013 02:15:37 +0200 (CEST)

hrev45528 adds 1 changeset to branch 'master'
old head: 3464764f7db09e16b8eba63249819cb7bdde9e74
new head: 9e5508fab4d41233873460d65021166f5c228fed
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=9e5508f+%5E3464764

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

9e5508f: Move the alert to the middle of the window

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

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

Revision:    hrev45528
Commit:      9e5508fab4d41233873460d65021166f5c228fed
URL:         http://cgit.haiku-os.org/haiku/commit/?id=9e5508f
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Sat Apr 20 00:15:24 2013 UTC

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

1 file changed, 8 insertions(+)
src/apps/stylededit/StyledEditWindow.cpp | 8 ++++++++

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

diff --git a/src/apps/stylededit/StyledEditWindow.cpp 
b/src/apps/stylededit/StyledEditWindow.cpp
index 4469d1d..9d45aa5 100644
--- a/src/apps/stylededit/StyledEditWindow.cpp
+++ b/src/apps/stylededit/StyledEditWindow.cpp
@@ -1842,6 +1842,10 @@ StyledEditWindow::_ShowStatistics()
        BAlert* alert = new BAlert("Statistics", result, B_TRANSLATE("OK"), 
NULL,
                NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
        alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
+       // Move the alert to the middle of the window
+       alert->MoveTo(Frame().LeftTop().x + Frame().Width() / 2
+                       - alert->Frame().Width() / 2,
+               Frame().LeftTop().y + Frame().Height() / 4);
 
        return alert->Go();
 }
@@ -1897,6 +1901,10 @@ StyledEditWindow::_ShowAlert(const BString& text, const 
BString& label,
        BAlert* alert = new BAlert("Alert", text.String(), label.String(), 
button2,
                button3, B_WIDTH_AS_USUAL, spacing, type);
        alert->SetShortcut(0, B_ESCAPE);
+       // Move the alert to the middle of the window
+       alert->MoveTo(Frame().LeftTop().x + Frame().Width() / 2
+                       - alert->Frame().Width() / 2,
+               Frame().LeftTop().y + Frame().Height() / 4);
 
        return alert->Go();
 }


Other related posts: