diff options
Diffstat (limited to 'indra/newview/llfloaternamedesc.cpp')
-rw-r--r-- | indra/newview/llfloaternamedesc.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index d4c9478fdf..1cac8fd4c5 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -106,10 +106,10 @@ BOOL LLFloaterNameDesc::postBuild() setTitle(mFilename); - centerWindow(); + centerWithin(gViewerWindow->getRootView()->getRect()); - S32 line_width = mRect.getWidth() - 2 * PREVIEW_HPAD; - S32 y = mRect.getHeight() - PREVIEW_LINE_HEIGHT; + S32 line_width = getRect().getWidth() - 2 * PREVIEW_HPAD; + S32 y = getRect().getHeight() - PREVIEW_LINE_HEIGHT; r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); y -= PREVIEW_LINE_HEIGHT; @@ -158,19 +158,6 @@ LLFloaterNameDesc::~LLFloaterNameDesc() gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() } -//----------------------------------------------------------------------------- -// centerWindow() -//----------------------------------------------------------------------------- -void LLFloaterNameDesc::centerWindow() -{ - LLRect window_rect = gViewerWindow->getRootView()->getRect(); - - S32 dialog_left = window_rect.mLeft + (window_rect.getWidth() - mRect.getWidth()) / 2; - S32 dialog_bottom = window_rect.mBottom + (window_rect.getHeight() - mRect.getHeight()) / 2; - - translate( dialog_left - mRect.mLeft, dialog_bottom - mRect.mBottom ); -} - // Sub-classes should override this function if they allow editing //----------------------------------------------------------------------------- // onCommit() |