[haiku-commits] haiku: hrev50816 - src/kits/interface docs/user/interface

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 1 Jan 2017 21:28:35 +0100 (CET)

hrev50816 adds 1 changeset to branch 'master'
old head: 74d5847f9960fe06108e7b3890620910bb6fb58e
new head: e1304871bb533e7cf4a93e2096e994a563d65120
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=e1304871bb53+%5E74d5847f9960

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

e1304871bb53: Revert "BWindow: CenterOnScreen a bit above center"
  
  This reverts commit a5be1832cc9f29a230e587c77793e624ec4fbd2a.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

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

Revision:    hrev50816
Commit:      e1304871bb533e7cf4a93e2096e994a563d65120
URL:         http://cgit.haiku-os.org/haiku/commit/?id=e1304871bb53
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Sun Jan  1 20:25:05 2017 UTC

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

3 files changed, 4 insertions(+), 59 deletions(-)
docs/user/interface/Window.dox | 12 +---------
headers/os/interface/Window.h  |  2 --
src/kits/interface/Window.cpp  | 49 +++-----------------------------------

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

diff --git a/docs/user/interface/Window.dox b/docs/user/interface/Window.dox
index 17bdf36..4d7653b 100644
--- a/docs/user/interface/Window.dox
+++ b/docs/user/interface/Window.dox
@@ -1954,11 +1954,7 @@
 
 /*!
        \fn void BWindow::CenterOnScreen()
-       \brief Centers the window on the current screen.
-
-       The window is positioned on the screen a bit above center. If you want 
to
-       center the window exactly in the middle you'll need to use
-       BWindow::CenterIn() instead.
+       \brief Centers the window on the screen the window is currently on.
 
        \since Haiku R1
 */
@@ -1968,12 +1964,6 @@
        \fn void BWindow::CenterOnScreen(screen_id id)
        \brief Centers the window on the screen with the passed in \a id.
 
-       \param id The screen_id of the screen to center the window in.
-
-       The window is positioned on the screen a bit above center. If you want 
to
-       center the window exactly in the middle you'll need to use
-       BWindow::CenterIn() instead.
-
        \since Haiku R1
 */
 
diff --git a/headers/os/interface/Window.h b/headers/os/interface/Window.h
index 35d0adb..c59a549 100644
--- a/headers/os/interface/Window.h
+++ b/headers/os/interface/Window.h
@@ -366,8 +366,6 @@ private:
                                                                        float* 
_tabHeight) const;
                        void                            
_SendShowOrHideMessage();
 
-                       void                            
_CenterAboveCenter(BRect rect);
-
 private:
                        char*                           fTitle;
                        int32                           _unused0;
diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp
index 4413df4..4be291a 100644
--- a/src/kits/interface/Window.cpp
+++ b/src/kits/interface/Window.cpp
@@ -2568,7 +2568,6 @@ BWindow::ResizeToPreferred()
 }
 
 
-// Centers the window in rect.
 void
 BWindow::CenterIn(const BRect& rect)
 {
@@ -2583,21 +2582,18 @@ BWindow::CenterIn(const BRect& rect)
 }
 
 
-// Centers the window offset a bit above center on the current screen.
 void
 BWindow::CenterOnScreen()
 {
-       BRect screenFrame(BScreen(this).Frame());
-       _CenterAboveCenter(screenFrame);
+       CenterIn(BScreen(this).Frame());
 }
 
 
-// Centers the window offset a bit above center on the screen specified by id.
+// Centers the window on the screen with the passed in id.
 void
 BWindow::CenterOnScreen(screen_id id)
 {
-       BRect screenFrame(BScreen(id).Frame());
-       _CenterAboveCenter(screenFrame);
+       CenterIn(BScreen(id).Frame());
 }
 
 
@@ -4184,45 +4180,6 @@ BWindow::_SendShowOrHideMessage()
 }
 
 
-// Centers the window in the rect offset a bit above center.
-void
-BWindow::_CenterAboveCenter(BRect rect)
-{
-       BAutolock locker(this);
-
-       // Set size limits now if needed
-       UpdateSizeLimits();
-
-       BPoint centered = BLayoutUtils::AlignInFrame(rect, Size(),
-               BAlignment(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER))
-                       .LeftTop();
-       centered.y -= floorf(rect.Height() / 16);
-               // Offset y coordinate so that the window is positioned like 
this:
-
-       // ----------------------------------------------------------
-       // |                                                        |
-       // |                                                        |
-       // |                _________                               |
-       // |               [_]_______|_____________                 |
-       // |               |                       |                |
-       // |               |                       |                |
-       // |               |                       |                |
-       // |               |                       |                |
-       // |               |                       |                |
-       // |               |                       |                |
-       // |               |_______________________|                |
-       // |                                                        |
-       // |                                                        |
-       // |                                                        |
-       // |                                                        |
-       // |                                                        |
-       // |                                                        |
-       // ----------------------------------------------------------
-
-       MoveTo(centered);
-}
-
-
 //     #pragma mark - C++ binary compatibility kludge
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev50816 - src/kits/interface docs/user/interface - jscipione