aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llviewerwindow.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerwindow.cpp271
1 files changed, 120 insertions, 151 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 86c43bf..a8ff246 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -266,6 +266,8 @@ const S32 PICK_DIAMETER = 2 * PICK_HALF_WIDTH+1;
266 266
267const F32 MIN_DISPLAY_SCALE = 0.85f; 267const F32 MIN_DISPLAY_SCALE = 0.85f;
268 268
269const S32 CONSOLE_BOTTOM_PAD = 40;
270
269#ifdef SABINRIG 271#ifdef SABINRIG
270/// ALL RIG STUFF 272/// ALL RIG STUFF
271bool rigControl = false; 273bool rigControl = false;
@@ -663,18 +665,17 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
663 665
664 // Topmost view gets a chance before the hierarchy 666 // Topmost view gets a chance before the hierarchy
665 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); 667 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
666 BOOL mouse_over_top_ctrl = FALSE;
667 if (top_ctrl) 668 if (top_ctrl)
668 { 669 {
669 S32 local_x, local_y; 670 S32 local_x, local_y;
670 top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); 671 top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
671 if (top_ctrl->pointInView(local_x, local_y)) 672 if (top_ctrl->pointInView(local_x, local_y))
672 { 673 {
673 mouse_over_top_ctrl = TRUE; 674 return top_ctrl->handleMouseDown(local_x, local_y, mask);
674 if(top_ctrl->handleMouseDown(local_x, local_y, mask)) 675 }
675 { 676 else
676 return TRUE; 677 {
677 } 678 setTopCtrl(NULL);
678 } 679 }
679 } 680 }
680 681
@@ -686,11 +687,6 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
686 llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; 687 llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl;
687 LLView::sMouseHandlerMessage = ""; 688 LLView::sMouseHandlerMessage = "";
688 } 689 }
689 if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
690 {
691 // always defocus top view if we click off of it
692 top_ctrl->setFocus(FALSE);
693 }
694 return TRUE; 690 return TRUE;
695 } 691 }
696 else if (LLView::sDebugMouseHandling) 692 else if (LLView::sDebugMouseHandling)
@@ -698,12 +694,6 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
698 llinfos << "Left Mouse Down not handled by view" << llendl; 694 llinfos << "Left Mouse Down not handled by view" << llendl;
699 } 695 }
700 696
701 if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
702 {
703 // always defocus top view if we click off of it
704 top_ctrl->setFocus(FALSE);
705 }
706
707 if (gDisconnected) 697 if (gDisconnected)
708 { 698 {
709 return FALSE; 699 return FALSE;
@@ -716,7 +706,7 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
716 // This is necessary to force clicks in the world to cause edit 706 // This is necessary to force clicks in the world to cause edit
717 // boxes that might have keyboard focus to relinquish it, and hence 707 // boxes that might have keyboard focus to relinquish it, and hence
718 // cause a commit to update their value. JC 708 // cause a commit to update their value. JC
719 gFocusMgr.setKeyboardFocus(NULL, NULL); 709 gFocusMgr.setKeyboardFocus(NULL);
720 return TRUE; 710 return TRUE;
721 } 711 }
722 } 712 }
@@ -760,18 +750,17 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
760 750
761 // Check for hit on UI. 751 // Check for hit on UI.
762 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); 752 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
763 BOOL mouse_over_top_ctrl = FALSE;
764 if (top_ctrl) 753 if (top_ctrl)
765 { 754 {
766 S32 local_x, local_y; 755 S32 local_x, local_y;
767 top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); 756 top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
768 if (top_ctrl->pointInView(local_x, local_y)) 757 if (top_ctrl->pointInView(local_x, local_y))
769 { 758 {
770 mouse_over_top_ctrl = TRUE; 759 return top_ctrl->handleDoubleClick(local_x, local_y, mask);
771 if(top_ctrl->handleDoubleClick(local_x, local_y, mask)) 760 }
772 { 761 else
773 return TRUE; 762 {
774 } 763 setTopCtrl(NULL);
775 } 764 }
776 } 765 }
777 766
@@ -782,11 +771,6 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
782 llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; 771 llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl;
783 LLView::sMouseHandlerMessage = ""; 772 LLView::sMouseHandlerMessage = "";
784 } 773 }
785 if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
786 {
787 // always defocus top view if we click off of it
788 top_ctrl->setFocus(FALSE);
789 }
790 return TRUE; 774 return TRUE;
791 } 775 }
792 else if (LLView::sDebugMouseHandling) 776 else if (LLView::sDebugMouseHandling)
@@ -794,12 +778,6 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
794 llinfos << "Left Mouse Down not handled by view" << llendl; 778 llinfos << "Left Mouse Down not handled by view" << llendl;
795 } 779 }
796 780
797 if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
798 {
799 // always defocus top view if we click off of it
800 top_ctrl->setFocus(FALSE);
801 }
802
803 // Why is this here? JC 9/3/2002 781 // Why is this here? JC 9/3/2002
804 if (gNoRender) 782 if (gNoRender)
805 { 783 {
@@ -970,18 +948,17 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
970 } 948 }
971 949
972 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); 950 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
973 BOOL mouse_over_top_ctrl = FALSE;
974 if (top_ctrl) 951 if (top_ctrl)
975 { 952 {
976 S32 local_x, local_y; 953 S32 local_x, local_y;
977 top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); 954 top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
978 if (top_ctrl->pointInView(local_x, local_y)) 955 if (top_ctrl->pointInView(local_x, local_y))
979 { 956 {
980 mouse_over_top_ctrl = TRUE; 957 return top_ctrl->handleRightMouseDown(local_x, local_y, mask);
981 if(top_ctrl->handleRightMouseDown(local_x, local_y, mask)) 958 }
982 { 959 else
983 return TRUE; 960 {
984 } 961 setTopCtrl(NULL);
985 } 962 }
986 } 963 }
987 964
@@ -992,11 +969,6 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
992 llinfos << "Right Mouse Down" << LLView::sMouseHandlerMessage << llendl; 969 llinfos << "Right Mouse Down" << LLView::sMouseHandlerMessage << llendl;
993 LLView::sMouseHandlerMessage = ""; 970 LLView::sMouseHandlerMessage = "";
994 } 971 }
995 if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
996 {
997 // always defocus top view if we click off of it
998 top_ctrl->setFocus(FALSE);
999 }
1000 return TRUE; 972 return TRUE;
1001 } 973 }
1002 else if (LLView::sDebugMouseHandling) 974 else if (LLView::sDebugMouseHandling)
@@ -1004,12 +976,6 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
1004 llinfos << "Right Mouse Down not handled by view" << llendl; 976 llinfos << "Right Mouse Down not handled by view" << llendl;
1005 } 977 }
1006 978
1007 if (top_ctrl && top_ctrl->hasFocus() && !mouse_over_top_ctrl)
1008 {
1009 // always defocus top view if we click off of it
1010 top_ctrl->setFocus(FALSE);
1011 }
1012
1013 if (gToolMgr) 979 if (gToolMgr)
1014 { 980 {
1015 if(gToolMgr->getCurrentTool()->handleRightMouseDown( x, y, mask ) ) 981 if(gToolMgr->getCurrentTool()->handleRightMouseDown( x, y, mask ) )
@@ -1017,7 +983,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
1017 // This is necessary to force clicks in the world to cause edit 983 // This is necessary to force clicks in the world to cause edit
1018 // boxes that might have keyboard focus to relinquish it, and hence 984 // boxes that might have keyboard focus to relinquish it, and hence
1019 // cause a commit to update their value. JC 985 // cause a commit to update their value. JC
1020 gFocusMgr.setKeyboardFocus(NULL, NULL); 986 gFocusMgr.setKeyboardFocus(NULL);
1021 return TRUE; 987 return TRUE;
1022 } 988 }
1023 } 989 }
@@ -1266,7 +1232,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
1266 1232
1267 // JC - Leave keyboard focus, so if you're popping in and out editing 1233 // JC - Leave keyboard focus, so if you're popping in and out editing
1268 // a script, you don't have to click in the editor again and again. 1234 // a script, you don't have to click in the editor again and again.
1269 // gFocusMgr.setKeyboardFocus( NULL, NULL ); 1235 // gFocusMgr.setKeyboardFocus( NULL );
1270 gShowTextEditCursor = FALSE; 1236 gShowTextEditCursor = FALSE;
1271 1237
1272 // If losing focus while keys are down, reset them. 1238 // If losing focus while keys are down, reset them.
@@ -1451,7 +1417,8 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
1451 case SLURL_MESSAGE_TYPE: 1417 case SLURL_MESSAGE_TYPE:
1452 // received URL 1418 // received URL
1453 std::string url = (const char*)data; 1419 std::string url = (const char*)data;
1454 if (LLURLDispatcher::dispatch(url)) 1420 const bool from_external_browser = true;
1421 if (LLURLDispatcher::dispatch(url, from_external_browser))
1455 { 1422 {
1456 // bring window to foreground, as it has just been "launched" from a URL 1423 // bring window to foreground, as it has just been "launched" from a URL
1457 mWindow->bringToFront(); 1424 mWindow->bringToFront();
@@ -1746,14 +1713,6 @@ void LLViewerWindow::initBase()
1746 gDebugView->setVisible(TRUE); 1713 gDebugView->setVisible(TRUE);
1747 mRootView->addChild(gDebugView); 1714 mRootView->addChild(gDebugView);
1748 1715
1749 // HUD elements just below floaters
1750 LLRect hud_rect = full_window;
1751 hud_rect.mTop -= 24;
1752 hud_rect.mBottom += STATUS_BAR_HEIGHT;
1753 gHUDView = new LLHUDView("hud_view", hud_rect);
1754 gHUDView->setFollowsAll();
1755 mRootView->addChild(gHUDView);
1756
1757 // Add floater view at the end so it will be on top, and give it tab priority over others 1716 // Add floater view at the end so it will be on top, and give it tab priority over others
1758 mRootView->addChild(gFloaterView, -1); 1717 mRootView->addChild(gFloaterView, -1);
1759 mRootView->addChild(gSnapshotFloaterView); 1718 mRootView->addChild(gSnapshotFloaterView);
@@ -1823,6 +1782,22 @@ void adjust_rect_bottom_center(const LLString& control, const LLRect& window)
1823 } 1782 }
1824} 1783}
1825 1784
1785
1786void update_saved_window_size(const LLString& control,S32 delta_width, S32 delta_height)
1787{
1788 if (delta_width || delta_height )
1789 {
1790 LLRect mXMLRect = gSavedSettings.getRect(control);
1791 //hard code it all follows the right and top
1792 mXMLRect.mRight += delta_width;
1793 mXMLRect.mTop += delta_height;
1794 mXMLRect.mLeft = llmax (0, mXMLRect.mLeft+delta_width);
1795 mXMLRect.mBottom = llmax(0,mXMLRect.mBottom+delta_height);
1796 gSavedSettings.setRect(control,mXMLRect);
1797 }
1798}
1799
1800
1826// Many rectangles can't be placed until we know the screen size. 1801// Many rectangles can't be placed until we know the screen size.
1827// These rectangles have their bottom-left corner as 0,0 1802// These rectangles have their bottom-left corner as 0,0
1828void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) 1803void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window)
@@ -1871,27 +1846,10 @@ void LLViewerWindow::initWorldUI()
1871 S32 width = mRootView->getRect().getWidth(); 1846 S32 width = mRootView->getRect().getWidth();
1872 LLRect full_window(0, height, width, 0); 1847 LLRect full_window(0, height, width, 0);
1873 1848
1874 if ( gToolBar == NULL ) // Don't re-enter if objects are alreay created 1849 if ( gBottomPanel == NULL ) // Don't re-enter if objects are alreay created
1875 { 1850 {
1876 LLRect bar_rect(-1, STATUS_BAR_HEIGHT, width+1, -1);
1877 gToolBar = new LLToolBar("toolbar", bar_rect);
1878
1879 LLRect chat_bar_rect(-1,CHAT_BAR_HEIGHT, width+1, -1);
1880 chat_bar_rect.translate(0, STATUS_BAR_HEIGHT-1);
1881 gChatBar = new LLChatBar("chat", chat_bar_rect);
1882
1883 bar_rect.translate(0, STATUS_BAR_HEIGHT-1);
1884 bar_rect.translate(0, CHAT_BAR_HEIGHT-1);
1885 gOverlayBar = new LLOverlayBar("overlay", bar_rect);
1886
1887 // panel containing chatbar, toolbar, and overlay, over floaters 1851 // panel containing chatbar, toolbar, and overlay, over floaters
1888 LLRect bottom_rect(-1, 2*STATUS_BAR_HEIGHT + CHAT_BAR_HEIGHT, width+1, -1); 1852 gBottomPanel = new LLBottomPanel(mRootView->getRect());
1889 gBottomPanel = new LLBottomPanel("bottom panel", bottom_rect);
1890
1891 // the order here is important
1892 gBottomPanel->addChild(gChatBar);
1893 gBottomPanel->addChild(gToolBar);
1894 gBottomPanel->addChild(gOverlayBar);
1895 mRootView->addChild(gBottomPanel); 1853 mRootView->addChild(gBottomPanel);
1896 1854
1897 // View for hover information 1855 // View for hover information
@@ -1923,8 +1881,7 @@ void LLViewerWindow::initWorldUI()
1923 mRootView->addChild(gMorphView); 1881 mRootView->addChild(gMorphView);
1924 gMorphView->setVisible(FALSE); 1882 gMorphView->setVisible(FALSE);
1925 1883
1926 gFloaterMute = new LLFloaterMute(); 1884 gFloaterMute = LLFloaterMute::getInstance();
1927 gFloaterMute->setVisible(FALSE);
1928 1885
1929 LLWorldMapView::initClass(); 1886 LLWorldMapView::initClass();
1930 1887
@@ -2119,7 +2076,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
2119 glViewport(0, 0, width, height ); 2076 glViewport(0, 0, width, height );
2120 2077
2121 if (height > 0 && gCamera) 2078 if (height > 0 && gCamera)
2122 { 2079 {
2123 gCamera->setViewHeightInPixels( height ); 2080 gCamera->setViewHeightInPixels( height );
2124 if (mWindow->getFullscreen()) 2081 if (mWindow->getFullscreen())
2125 { 2082 {
@@ -2132,6 +2089,9 @@ void LLViewerWindow::reshape(S32 width, S32 height)
2132 } 2089 }
2133 } 2090 }
2134 2091
2092 // changes in window's width and hight
2093 S32 delta_width = width - mWindowRect.getWidth();
2094 S32 delta_height = height - mWindowRect.getHeight();
2135 // update our window rectangle 2095 // update our window rectangle
2136 mWindowRect.mRight = mWindowRect.mLeft + width; 2096 mWindowRect.mRight = mWindowRect.mLeft + width;
2137 mWindowRect.mTop = mWindowRect.mBottom + height; 2097 mWindowRect.mTop = mWindowRect.mBottom + height;
@@ -2182,6 +2142,12 @@ void LLViewerWindow::reshape(S32 width, S32 height)
2182 { 2142 {
2183 gSavedSettings.setS32("WindowWidth", window_size.mX); 2143 gSavedSettings.setS32("WindowWidth", window_size.mX);
2184 gSavedSettings.setS32("WindowHeight", window_size.mY); 2144 gSavedSettings.setS32("WindowHeight", window_size.mY);
2145 if (!gFloaterMap)
2146 {
2147 update_saved_window_size("FloaterWorldMapRect",delta_width, delta_height);
2148 update_saved_window_size("FloaterMapRect",delta_width, delta_height);
2149 }
2150
2185 } 2151 }
2186 } 2152 }
2187 2153
@@ -2205,11 +2171,11 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible )
2205 gMenuBarView->setVisible( visible ); 2171 gMenuBarView->setVisible( visible );
2206 gMenuBarView->setEnabled( visible ); 2172 gMenuBarView->setEnabled( visible );
2207 2173
2208 // ...and set the menu color appropriately. 2174 // ...and set the menu color appropriately.
2209 setMenuBackgroundColor(gAgent.getGodLevel() > GOD_NOT, 2175 setMenuBackgroundColor(gAgent.getGodLevel() > GOD_NOT,
2210 LLAppViewer::instance()->isInProductionGrid()); 2176 LLAppViewer::instance()->isInProductionGrid());
2211 } 2177 }
2212 2178
2213 if ( gStatusBar ) 2179 if ( gStatusBar )
2214 { 2180 {
2215 gStatusBar->setVisible( visible ); 2181 gStatusBar->setVisible( visible );
@@ -2461,7 +2427,9 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2461 { 2427 {
2462 BOOL visible = ! gSavedSettings.getBOOL("ForceShowGrid"); 2428 BOOL visible = ! gSavedSettings.getBOOL("ForceShowGrid");
2463 gSavedSettings.setBOOL("ForceShowGrid", visible); 2429 gSavedSettings.setBOOL("ForceShowGrid", visible);
2464 LLPanelLogin::loadLoginPage(); 2430
2431 // Initialize visibility (and don't force visibility - use prefs)
2432 LLPanelLogin::refreshLocation( false );
2465 } 2433 }
2466 } 2434 }
2467 2435
@@ -2482,6 +2450,16 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2482 return TRUE; 2450 return TRUE;
2483 } 2451 }
2484 2452
2453 //if quit from menu, turn off the Keyboardmode for the menu.
2454 if(LLMenuGL::getKeyboardMode())
2455 LLMenuGL::setKeyboardMode(FALSE);
2456
2457 if (gFocusMgr.getTopCtrl())
2458 {
2459 gFocusMgr.setTopCtrl(NULL);
2460 return TRUE;
2461 }
2462
2485 // *TODO: get this to play well with mouselook and hidden 2463 // *TODO: get this to play well with mouselook and hidden
2486 // cursor modes, etc, and re-enable. 2464 // cursor modes, etc, and re-enable.
2487 //if (gFocusMgr.getMouseCapture()) 2465 //if (gFocusMgr.getMouseCapture())
@@ -3022,23 +3000,9 @@ BOOL LLViewerWindow::handlePerFrameHover()
3022 } 3000 }
3023 3001
3024 // Update rectangles for the various toolbars 3002 // Update rectangles for the various toolbars
3025 if (gToolBar && gChatBar && gOverlayBar && gNotifyBoxView && gConsole) 3003 if (gOverlayBar && gNotifyBoxView && gConsole)
3026 { 3004 {
3027 LLRect bar_rect(-1, STATUS_BAR_HEIGHT, getWindowWidth()+1, -1); 3005 LLRect bar_rect(-1, STATUS_BAR_HEIGHT, getWindowWidth()+1, -1);
3028 if (gToolBar->getVisible())
3029 {
3030 gToolBar->setRect(bar_rect);
3031 bar_rect.translate(0, STATUS_BAR_HEIGHT-1);
3032 }
3033
3034 if (gChatBar->getVisible())
3035 {
3036 // fix up the height
3037 LLRect chat_bar_rect = bar_rect;
3038 chat_bar_rect.mTop = chat_bar_rect.mBottom + CHAT_BAR_HEIGHT + 1;
3039 gChatBar->setRect(chat_bar_rect);
3040 bar_rect.translate(0, CHAT_BAR_HEIGHT-1);
3041 }
3042 3006
3043 LLRect notify_box_rect = gNotifyBoxView->getRect(); 3007 LLRect notify_box_rect = gNotifyBoxView->getRect();
3044 notify_box_rect.mBottom = bar_rect.mBottom; 3008 notify_box_rect.mBottom = bar_rect.mBottom;
@@ -3056,44 +3020,28 @@ BOOL LLViewerWindow::handlePerFrameHover()
3056 gFloaterView->setRect(floater_rect); 3020 gFloaterView->setRect(floater_rect);
3057 } 3021 }
3058 3022
3059 if (gOverlayBar->getVisible()) 3023 // snap floaters to top of chat bar/button strip
3024 LLView* chatbar_and_buttons = gOverlayBar->getChildByName("chatbar_and_buttons", TRUE);
3025 if (chatbar_and_buttons)
3060 { 3026 {
3061 LLRect overlay_rect = bar_rect; 3027 // convert top/left corner of chatbar/buttons container to gFloaterView-relative coordinates
3062 overlay_rect.mTop = overlay_rect.mBottom + OVERLAY_BAR_HEIGHT; 3028 S32 top, left;
3063 3029 chatbar_and_buttons->localPointToOtherView(
3064 // Fitt's Law: Push buttons flush with bottom of screen if 3030 chatbar_and_buttons->getLocalBoundingRect().mLeft,
3065 // nothing else visible. 3031 chatbar_and_buttons->getLocalBoundingRect().mTop,
3066 if (!gToolBar->getVisible() 3032 &left,
3067 && !gChatBar->getVisible()) 3033 &top,
3068 { 3034 gFloaterView);
3069 // *NOTE: this is highly depenent on the XML 3035 gFloaterView->setSnapOffsetBottom(top);
3070 // describing the position of the buttons
3071 overlay_rect.translate(0, 0);
3072 }
3073
3074 gOverlayBar->setRect(overlay_rect);
3075 gOverlayBar->updateRect();
3076 bar_rect.translate(0, gOverlayBar->getRect().getHeight());
3077
3078 gFloaterView->setSnapOffsetBottom(OVERLAY_BAR_HEIGHT);
3079 } 3036 }
3080 else 3037 else
3081 { 3038 {
3082 gFloaterView->setSnapOffsetBottom(0); 3039 gFloaterView->setSnapOffsetBottom(0);
3083 } 3040 }
3084 3041
3085 // fix rectangle of bottom panel focus indicator
3086 if(gBottomPanel && gBottomPanel->getFocusIndicator())
3087 {
3088 LLRect focus_rect = gBottomPanel->getFocusIndicator()->getRect();
3089 focus_rect.mTop = (gToolBar->getVisible() ? STATUS_BAR_HEIGHT : 0) +
3090 (gChatBar->getVisible() ? CHAT_BAR_HEIGHT : 0) - 2;
3091 gBottomPanel->getFocusIndicator()->setRect(focus_rect);
3092 }
3093
3094 // Always update console 3042 // Always update console
3095 LLRect console_rect = gConsole->getRect(); 3043 LLRect console_rect = gConsole->getRect();
3096 console_rect.mBottom = bar_rect.mBottom + 8; 3044 console_rect.mBottom = gHUDView->getRect().mBottom + CONSOLE_BOTTOM_PAD;
3097 gConsole->reshape(console_rect.getWidth(), console_rect.getHeight()); 3045 gConsole->reshape(console_rect.getWidth(), console_rect.getHeight());
3098 gConsole->setRect(console_rect); 3046 gConsole->setRect(console_rect);
3099 } 3047 }
@@ -3671,13 +3619,6 @@ void LLViewerWindow::performPick()
3671 // if you are the parent 3619 // if you are the parent
3672 parent = objectp; 3620 parent = objectp;
3673 } 3621 }
3674 std::vector<LLPointer<LLViewerObject>,std::allocator<LLPointer<LLViewerObject> > > children = parent->getChildren();
3675 for( std::vector<LLPointer<LLViewerObject>,std::allocator<LLPointer<LLViewerObject> > >::iterator i= children.begin(); i!= children.end(); ++i )
3676 {
3677 //go through
3678 LLViewerObject* foo = *i;
3679 foo->getRotation();
3680 }
3681 if (objectp->mbCanSelect) 3622 if (objectp->mbCanSelect)
3682 { 3623 {
3683 te_offset = (te_offset == 16) ? NO_FACE : te_offset; 3624 te_offset = (te_offset == 16) ? NO_FACE : te_offset;
@@ -4604,9 +4545,9 @@ void LLViewerWindow::drawMouselookInstructions()
4604// These functions are here only because LLViewerWindow used to do the work that gFocusMgr does now. 4545// These functions are here only because LLViewerWindow used to do the work that gFocusMgr does now.
4605// They let other objects continue to work without change. 4546// They let other objects continue to work without change.
4606 4547
4607void LLViewerWindow::setKeyboardFocus(LLUICtrl* new_focus,void (*on_focus_lost)(LLUICtrl* old_focus)) 4548void LLViewerWindow::setKeyboardFocus(LLUICtrl* new_focus)
4608{ 4549{
4609 gFocusMgr.setKeyboardFocus( new_focus, on_focus_lost ); 4550 gFocusMgr.setKeyboardFocus( new_focus );
4610} 4551}
4611 4552
4612LLUICtrl* LLViewerWindow::getKeyboardFocus() 4553LLUICtrl* LLViewerWindow::getKeyboardFocus()
@@ -5076,7 +5017,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
5076 } 5017 }
5077 5018
5078 mIgnoreActivate = FALSE; 5019 mIgnoreActivate = FALSE;
5079 gFocusMgr.setKeyboardFocus(keyboard_focus, NULL); 5020 gFocusMgr.setKeyboardFocus(keyboard_focus);
5080 mWantFullscreen = mWindow->getFullscreen(); 5021 mWantFullscreen = mWindow->getFullscreen();
5081 mShowFullscreenProgress = FALSE; 5022 mShowFullscreenProgress = FALSE;
5082 5023
@@ -5276,16 +5217,22 @@ LLAlertDialog* LLViewerWindow::alertXmlEditText(const std::string& xml_filename,
5276 5217
5277//////////////////////////////////////////////////////////////////////////// 5218////////////////////////////////////////////////////////////////////////////
5278 5219
5279LLBottomPanel::LLBottomPanel(const LLString &name, const LLRect &rect) : 5220LLBottomPanel::LLBottomPanel(const LLRect &rect) :
5280 LLPanel(name, rect, FALSE), 5221 LLPanel("", rect, FALSE),
5281 mIndicator(NULL) 5222 mIndicator(NULL)
5282{ 5223{
5283 // bottom panel is focus root, so Tab moves through the toolbar and button bar, and overlay 5224 // bottom panel is focus root, so Tab moves through the toolbar and button bar, and overlay
5284 setFocusRoot(TRUE); 5225 setFocusRoot(TRUE);
5285 // don't capture mouse clicks that don't hit a child 5226 // flag this panel as chrome so buttons don't grab keyboard focus
5286 setMouseOpaque(FALSE);
5287 setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM);
5288 setIsChrome(TRUE); 5227 setIsChrome(TRUE);
5228
5229 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL);
5230 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL);
5231 mFactoryMap["hud"] = LLCallbackMap(createHUD, NULL);
5232 gUICtrlFactory->buildPanel(this, "panel_bars.xml", &getFactoryMap());
5233
5234 setOrigin(rect.mLeft, rect.mBottom);
5235 reshape(rect.getWidth(), rect.getHeight());
5289} 5236}
5290 5237
5291void LLBottomPanel::setFocusIndicator(LLView * indicator) 5238void LLBottomPanel::setFocusIndicator(LLView * indicator)
@@ -5303,3 +5250,25 @@ void LLBottomPanel::draw()
5303 } 5250 }
5304 LLPanel::draw(); 5251 LLPanel::draw();
5305} 5252}
5253
5254void* LLBottomPanel::createHUD(void* data)
5255{
5256 delete gHUDView;
5257 gHUDView = new LLHUDView();
5258 return gHUDView;
5259}
5260
5261
5262void* LLBottomPanel::createOverlayBar(void* data)
5263{
5264 delete gOverlayBar;
5265 gOverlayBar = new LLOverlayBar();
5266 return gOverlayBar;
5267}
5268
5269void* LLBottomPanel::createToolBar(void* data)
5270{
5271 delete gToolBar;
5272 gToolBar = new LLToolBar();
5273 return gToolBar;
5274}