From 0a7290772a6b39555adb966c7a48ef44151c1f05 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 5 Nov 2009 15:36:11 -0800 Subject: moved scroll_column_header default params to scroll_column_header.xml reviewed by James --- indra/llui/llscrolllistcolumn.cpp | 11 +++-------- indra/llui/llscrolllistctrl.cpp | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index ba53f84877..d281341202 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -44,6 +44,9 @@ const S32 MIN_COLUMN_WIDTH = 20; +// defaults for LLScrollColumnHeader param block pulled from widgets/scroll_column_header.xml +static LLWidgetNameRegistry::StaticRegistrar sRegisterColumnHeaderParams(&typeid(LLScrollColumnHeader::Params), "scroll_column_header"); + //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- @@ -51,15 +54,7 @@ LLScrollColumnHeader::Params::Params() : column("column") { name = "column_header"; - image_unselected.name("square_btn_32x128.tga"); - image_selected.name("square_btn_selected_32x128.tga"); - image_disabled.name("square_btn_32x128.tga"); - image_disabled_selected.name("square_btn_selected_32x128.tga"); - image_overlay.name("combobox_arrow.tga"); - image_overlay_alignment("right"); - font_halign = LLFontGL::LEFT; tab_stop(false); - scale_image(true); } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a6cd6412e5..1c2c02e1cc 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2624,7 +2624,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params LLRect temp_rect = LLRect(left,top+mHeadingHeight,right,top); - LLScrollColumnHeader::Params params; + LLScrollColumnHeader::Params params(LLUICtrlFactory::getDefaultParams()); params.name = "btn_" + name; params.rect = temp_rect; params.column = new_column; -- cgit v1.3 From fac0b6836a59681443fb2bbd13e6b5eb9c07cef5 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 5 Nov 2009 20:36:15 -0800 Subject: refactored top level ui into main_view.xml --- indra/llui/llfloater.cpp | 2 + indra/llui/llmenugl.cpp | 6 +- indra/llui/llmenugl.h | 4 +- indra/llui/lltooltip.cpp | 4 +- indra/newview/llbottomtray.cpp | 2 +- indra/newview/lldebugview.cpp | 6 +- indra/newview/lldebugview.h | 2 + indra/newview/llfloatersnapshot.cpp | 2 + indra/newview/llmoveview.cpp | 5 +- indra/newview/llviewermenu.cpp | 22 ++- indra/newview/llviewermenu.h | 5 + indra/newview/llviewerwindow.cpp | 177 ++++++++------------- indra/newview/skins/default/xui/en/floater_aaa.xml | 21 +-- indra/newview/skins/default/xui/en/main_view.xml | 138 ++++++++++++++++ 14 files changed, 239 insertions(+), 157 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/main_view.xml (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index aac27e6562..f2cdad8854 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1857,6 +1857,8 @@ void LLFloater::buildButtons() ///////////////////////////////////////////////////// // LLFloaterView +static LLDefaultChildRegistry::Register r("floater_view"); + LLFloaterView::LLFloaterView (const Params& p) : LLUICtrl (p), mFocusCycleMode(FALSE), diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 956e843987..f078b67912 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3247,11 +3247,9 @@ BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) ///============================================================================ LLCoordGL LLMenuHolderGL::sContextMenuSpawnPos(S32_MAX, S32_MAX); -LLMenuHolderGL::LLMenuHolderGL() - : LLPanel() +LLMenuHolderGL::LLMenuHolderGL(const LLMenuHolderGL::Params& p) + : LLPanel(p) { - setName("Menu Holder"); - setMouseOpaque(FALSE); sItemActivationTimer.stop(); mCanHide = TRUE; } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 09d9e407c7..b0681d252d 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -765,7 +765,9 @@ private: class LLMenuHolderGL : public LLPanel { public: - LLMenuHolderGL(); + struct Params : public LLInitParam::Block + {}; + LLMenuHolderGL(const Params& p); virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 4bc9a9c042..fe1c2ba67c 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -57,6 +57,8 @@ LLToolTipView *gToolTipView = NULL; // Member functions // +static LLDefaultChildRegistry::Register register_tooltip_view("tooltip_view"); + LLToolTipView::Params::Params() { mouse_opaque = false; @@ -142,7 +144,7 @@ void LLToolTipView::drawStickyRect() // -static LLDefaultChildRegistry::Register r("tool_tip"); +static LLDefaultChildRegistry::Register register_tooltip("tool_tip"); LLToolTip::Params::Params() diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index a17ba79078..4c15fdd1a2 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -71,7 +71,7 @@ LLBottomTray::LLBottomTray(const LLSD&) //this is to fix a crash that occurs because LLBottomTray is a singleton //and thus is deleted at the end of the viewers lifetime, but to be cleanly //destroyed LLBottomTray requires some subsystems that are long gone - LLUI::getRootView()->addChild(this); + //LLUI::getRootView()->addChild(this); // Necessary for focus movement among child controls setFocusRoot(TRUE); diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 24a57cb0c1..15d74c9793 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -55,12 +55,16 @@ LLDebugView* gDebugView = NULL; // // Methods // +static LLDefaultChildRegistry::Register r("debug_view"); LLDebugView::LLDebugView(const LLDebugView::Params& p) : LLView(p) +{} + +void LLDebugView::init() { LLRect r; - LLRect rect(p.rect); + LLRect rect = getLocalRect(); r.set(10, rect.getHeight() - 100, rect.getWidth()/2, 100); LLConsole::Params cp; diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 9cf2a59a0a..b17cdb43cd 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -60,6 +60,8 @@ public: LLDebugView(const Params&); ~LLDebugView(); + void init(); + void setStatsVisible(BOOL visible); LLFastTimerView* mFastTimerView; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index fd2e7b3487..347cc3a58e 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -101,6 +101,8 @@ S32 BORDER_WIDTH = 6; const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 +static LLDefaultChildRegistry::Register r("snapshot_floater_view"); + ///---------------------------------------------------------------------------- /// Class LLSnapshotLivePreview ///---------------------------------------------------------------------------- diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 14da35594f..b052087475 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -598,14 +598,11 @@ BOOL LLPanelStandStopFlying::postBuild() void LLPanelStandStopFlying::setVisible(BOOL visible) { //we dont need to show the panel if these buttons are not activated - if (visible && !mStandButton->getVisible() && !mStopFlyingButton->getVisible()) visible = false; - if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) visible = false; if (visible) { updatePosition(); - getParent()->sendChildToFront(this); } LLPanel::setVisible(visible); @@ -638,7 +635,7 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel() LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_stand_stop_flying.xml"); panel->setVisible(FALSE); - LLUI::getRootView()->addChild(panel); + //LLUI::getRootView()->addChild(panel); llinfos << "Build LLPanelStandStopFlying panel" << llendl; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b30acd47f1..ad8739585f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -467,16 +467,6 @@ void set_underclothes_menu_options() void init_menus() { S32 top = gViewerWindow->getRootView()->getRect().getHeight(); - S32 width = gViewerWindow->getRootView()->getRect().getWidth(); - - // - // Main menu bar - // - gMenuHolder = new LLViewerMenuHolderGL(); - gMenuHolder->setRect(LLRect(0, top, width, 0)); - gMenuHolder->setFollowsAll(); - - LLMenuGL::sMenuContainer = gMenuHolder; // Initialize actions initialize_menus(); @@ -7080,6 +7070,11 @@ void handle_test_load_url(void*) // // LLViewerMenuHolderGL // +static LLDefaultChildRegistry::Register r("menu_holder"); + +LLViewerMenuHolderGL::LLViewerMenuHolderGL(const LLViewerMenuHolderGL::Params& p) +: LLMenuHolderGL(p) +{} BOOL LLViewerMenuHolderGL::hideMenus() { @@ -7089,8 +7084,11 @@ BOOL LLViewerMenuHolderGL::hideMenus() mParcelSelection = NULL; mObjectSelection = NULL; - gMenuBarView->clearHoverItem(); - gMenuBarView->resetMenuTrigger(); + if (gMenuBarView) + { + gMenuBarView->clearHoverItem(); + gMenuBarView->resetMenuTrigger(); + } return handled; } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index b65878b5e6..50751d6066 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -132,6 +132,11 @@ void handle_export_selected( void * ); class LLViewerMenuHolderGL : public LLMenuHolderGL { public: + struct Params : public LLInitParam::Block + {}; + + LLViewerMenuHolderGL(const Params& p); + virtual BOOL hideMenus(); void setParcelSelection(LLSafeHandle selection); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9b3dbcd2f6..8630369971 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1373,6 +1373,10 @@ void LLViewerWindow::initGLDefaults() gCylinder.prerender(); } +struct MainPanel : public LLPanel +{ +}; + void LLViewerWindow::initBase() { S32 height = getWindowHeight(); @@ -1396,30 +1400,15 @@ void LLViewerWindow::initBase() // Create the floater view at the start so that other views can add children to it. // (But wait to add it as a child of the root view so that it will be in front of the // other views.) + MainPanel* main_view = new MainPanel(); + LLUICtrlFactory::instance().buildPanel(main_view, "main_view.xml"); + main_view->setShape(full_window); + getRootView()->addChild(main_view); // Constrain floaters to inside the menu and status bar regions. - LLRect floater_view_rect = full_window; - // make space for menu bar - floater_view_rect.mTop -= MENU_BAR_HEIGHT; - - LLFloaterView::Params fvparams; - fvparams.name("Floater View"); - fvparams.rect(floater_view_rect); - fvparams.mouse_opaque(false); - fvparams.follows.flags(FOLLOWS_ALL); - fvparams.tab_stop(false); - gFloaterView = LLUICtrlFactory::create (fvparams); - - LLSnapshotFloaterView::Params snapParams; - snapParams.name("Snapshot Floater View"); - snapParams.rect(full_window); - snapParams.enabled(false); - gSnapshotFloaterView = LLUICtrlFactory::create (snapParams); + gFloaterView = getRootView()->getChild("Floater View"); + gSnapshotFloaterView = getRootView()->getChild("Snapshot Floater View"); - // Snapshot floater must start invisible otherwise it eats all - // the tooltips. JC - gSnapshotFloaterView->setVisible(FALSE); - // Console llassert( !gConsole ); LLConsole::Params cp; @@ -1443,43 +1432,21 @@ void LLViewerWindow::initBase() } #endif - // Debug view over the console - LLDebugView::Params debug_p; - debug_p.name("DebugView"); - debug_p.rect(full_window); - debug_p.follows.flags(FOLLOWS_ALL); - debug_p.visible(true); - gDebugView = LLUICtrlFactory::create(debug_p); - getRootView()->addChild(gDebugView); - - // Add floater view at the end so it will be on top, and give it tab priority over others - getRootView()->addChild(gFloaterView, -1); - getRootView()->addChild(gSnapshotFloaterView); - - // notify above floaters! - LLRect notify_rect = floater_view_rect; - LLNotifyBoxView::Params p; - p.name("notify_container"); - p.rect(notify_rect); - p.mouse_opaque(false); - p.follows.flags(FOLLOWS_ALL); - gNotifyBoxView = LLUICtrlFactory::create (p); - getRootView()->addChild(gNotifyBoxView, -2); - - // View for tooltips - LLToolTipView::Params hvp; - hvp.name("tooltip view"); - hvp.rect(full_window); - hvp.follows.flags(FOLLOWS_ALL); - gToolTipView = LLUICtrlFactory::create(hvp); - gToolTipView->setFollowsAll(); - getRootView()->addChild(gToolTipView); + gDebugView = getRootView()->getChild("DebugView"); + gDebugView->init(); + gNotifyBoxView = getRootView()->getChild("notify_container"); + gToolTipView = getRootView()->getChild("tooltip view"); // Add the progress bar view (startup view), which overrides everything mProgressView = new LLProgressView(full_window); getRootView()->addChild(mProgressView); setShowProgress(FALSE); setProgressCancelButtonVisible(FALSE); + + gMenuHolder = getRootView()->getChild("Menu Holder"); + + LLMenuGL::sMenuContainer = gMenuHolder; + } void LLViewerWindow::initWorldUI() @@ -1488,20 +1455,22 @@ void LLViewerWindow::initWorldUI() S32 width = mRootView->getRect().getWidth(); LLRect full_window(0, height, width, 0); + gIMMgr = LLIMMgr::getInstance(); // side tray - getRootView()->addChild(LLSideTray::getInstance()); + //getRootView()->addChild(LLSideTray::getInstance()); getRootView()->sendChildToFront(gFloaterView); getRootView()->sendChildToFront(gSnapshotFloaterView); // new bottom panel - LLRect rc = LLBottomTray::getInstance()->getRect(); - rc.mLeft = 0; - rc.mRight = mRootView->getRect().getWidth(); - LLBottomTray::getInstance()->reshape(rc.getWidth(),rc.getHeight(),FALSE); - LLBottomTray::getInstance()->setRect(rc); + LLPanel* bottom_tray_container = getRootView()->getChild("bottom_tray_container"); + LLBottomTray* bottom_tray = LLBottomTray::getInstance(); + bottom_tray->setShape(bottom_tray_container->getLocalRect()); + bottom_tray->setFollows(FOLLOWS_ALL); + bottom_tray_container->addChild(bottom_tray); + bottom_tray_container->setVisible(TRUE); // Pre initialize instance communicate instance; // currently needs to happen before initializing chat or IM @@ -1517,17 +1486,6 @@ void LLViewerWindow::initWorldUI() gMorphView = LLUICtrlFactory::create(mvp); getRootView()->addChild(gMorphView); - // Make space for nav bar. - LLNavigationBar* navbar = LLNavigationBar::getInstance(); - LLRect floater_view_rect = gFloaterView->getRect(); - LLRect notify_view_rect = gNotifyBoxView->getRect(); - floater_view_rect.mTop -= navbar->getDefNavBarHeight(); - floater_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); - notify_view_rect.mTop -= navbar->getDefNavBarHeight(); - notify_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); - gFloaterView->setRect(floater_view_rect); - gNotifyBoxView->setRect(notify_view_rect); - LLWorldMapView::initClass(); // Force gFloaterWorldMap to initialize @@ -1538,22 +1496,22 @@ void LLViewerWindow::initWorldUI() LLFloaterReg::hideInstance("build"); // Status bar - S32 menu_bar_height = gMenuBarView->getRect().getHeight(); - LLRect root_rect = getRootView()->getRect(); - LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); - gStatusBar = new LLStatusBar(status_rect); - gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); - - gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); - gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); + LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); + gStatusBar = new LLStatusBar(status_bar_container->getLocalRect()); + gStatusBar->setFollows(FOLLOWS_ALL); // sync bg color with menu bar gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() ); + status_bar_container->addChild(gStatusBar); + status_bar_container->setVisible(TRUE); // Navigation bar - navbar->reshape(root_rect.getWidth(), navbar->getRect().getHeight(), TRUE); // *TODO: redundant? - navbar->translate(0, root_rect.getHeight() - menu_bar_height - navbar->getRect().getHeight()); // FIXME - navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + LLPanel* nav_bar_container = getRootView()->getChild("nav_bar_container"); + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + navbar->setShape(nav_bar_container->getLocalRect()); + navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + nav_bar_container->addChild(navbar); + nav_bar_container->setVisible(TRUE); if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel")) { @@ -1585,19 +1543,6 @@ void LLViewerWindow::initWorldUI() LLBottomTray::getInstance()->showGestureButton(FALSE); } - getRootView()->addChild(gStatusBar); - getRootView()->addChild(navbar); - - - //sidetray - //then notify area - //then menu - //getRootView()->sendChildToFront(LLSideTray::getInstance()); - - getRootView()->sendChildToFront(gNotifyBoxView); - // menu holder appears on top to get first pass at all mouse events - getRootView()->sendChildToFront(gMenuHolder); - if ( gHUDView == NULL ) { LLRect hud_rect = full_window; @@ -1611,11 +1556,13 @@ void LLViewerWindow::initWorldUI() getRootView()->addChildInBack(gHUDView); } - // this allows not to see UI elements created while UI initializing after Alt+Tab was pressed during login. EXT-744. - moveProgressViewToFront(); + LLPanel* panel_ssf_container = getRootView()->getChild("stand_stop_flying_container"); + LLPanelStandStopFlying* panel_stand_stop_flying = LLPanelStandStopFlying::getInstance(); + panel_stand_stop_flying->setShape(panel_ssf_container->getLocalRect()); + panel_stand_stop_flying->setFollows(FOLLOWS_ALL); + panel_ssf_container->addChild(panel_stand_stop_flying); + panel_ssf_container->setVisible(TRUE); - // tooltips are always on top - getRootView()->sendChildToFront(gToolTipView); } // Destroy the UI @@ -2327,26 +2274,26 @@ void LLViewerWindow::moveCursorToCenter() void LLViewerWindow::updateBottomTrayRect() { - if(LLBottomTray::instanceExists() && LLSideTray::instanceCreated()) - { - S32 side_tray_width = 0; - if(LLSideTray::getInstance()->getVisible()) - { - side_tray_width = LLSideTray::getInstance()->getTrayWidth(); - } + //if(LLBottomTray::instanceExists() && LLSideTray::instanceCreated()) + //{ + // S32 side_tray_width = 0; + // if(LLSideTray::getInstance()->getVisible()) + // { + // side_tray_width = LLSideTray::getInstance()->getTrayWidth(); + // } - LLBottomTray* bottom_tray = LLBottomTray::getInstance(); - S32 right = llround((F32)mWindowRect.mRight / mDisplayScale.mV[VX]) - side_tray_width; + // LLBottomTray* bottom_tray = LLBottomTray::getInstance(); + // S32 right = llround((F32)mWindowRect.mRight / mDisplayScale.mV[VX]) - side_tray_width; - LLRect rc = bottom_tray->getRect(); - if (right != rc.mRight) - { - rc.mRight = right; - bottom_tray->reshape(rc.getWidth(), rc.getHeight(), FALSE); - bottom_tray->setRect(rc); - mOnBottomTrayWidthChanged(); - } - } + // LLRect rc = bottom_tray->getRect(); + // if (right != rc.mRight) + // { + // rc.mRight = right; + // bottom_tray->reshape(rc.getWidth(), rc.getHeight(), FALSE); + // bottom_tray->setRect(rc); + // mOnBottomTrayWidthChanged(); + // } + //} } ////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 4d5268681b..d0d0cc64c5 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -1,24 +1,9 @@ - -This is line 4 - + width="1024"> + diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml new file mode 100644 index 0000000000..2d69465b58 --- /dev/null +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.3 From 4eb72a12a2280d3be6ac556ad80eb953d249e8eb Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 9 Nov 2009 15:29:47 -0800 Subject: data driven layout of top-level UI elements EXT-1219 Side tray slide-out animation cleaned up some layout of bottom tray contents reviewed by James --- .hgignore | 1 - indra/llui/llconsole.cpp | 2 + indra/llui/lllayoutstack.cpp | 43 ++++- indra/llui/lllayoutstack.h | 8 +- indra/llui/lluictrlfactory.h | 2 +- indra/llui/llview.cpp | 3 + indra/llui/llview.h | 3 - indra/newview/llfasttimerview.cpp | 3 +- indra/newview/llfloatersnapshot.cpp | 8 +- indra/newview/llmoveview.cpp | 2 +- indra/newview/llnavigationbar.cpp | 16 +- indra/newview/llpanelpeople.cpp | 3 +- indra/newview/llpanelpeoplemenus.cpp | 1 - indra/newview/llpanelprimmediacontrols.cpp | 1 + indra/newview/llpanelteleporthistory.cpp | 2 - indra/newview/llsidetray.cpp | 200 ++++---------------- indra/newview/llsidetray.h | 10 +- indra/newview/llviewerwindow.cpp | 79 +++----- indra/newview/llviewerwindow.h | 3 +- indra/newview/pipeline.cpp | 2 + indra/newview/skins/default/xui/en/main_view.xml | 203 ++++++++++++--------- .../skins/default/xui/en/panel_bottomtray.xml | 51 +++--- .../skins/default/xui/en/panel_status_bar.xml | 2 +- .../skins/default/xui/en/widgets/context_menu.xml | 2 + .../skins/default/xui/en/widgets/side_tray.xml | 9 +- .../default/xui/en/widgets/toggleable_menu.xml | 2 + 26 files changed, 293 insertions(+), 368 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/context_menu.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml (limited to 'indra/llui') diff --git a/.hgignore b/.hgignore index e390f591e5..4d98acf5d9 100644 --- a/.hgignore +++ b/.hgignore @@ -29,7 +29,6 @@ indra/newview/fmod.dll indra/newview/mozilla-theme indra/newview/mozilla-universal-darwin.tgz indra/newview/res-sdl -indra/newview/skins indra/newview/vivox-runtime indra/server-linux-* indra/test/linden_file.dat diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index e0053b4cc7..48c76cf105 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -60,6 +60,8 @@ LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow. const F32 FADE_DURATION = 2.f; const S32 MIN_CONSOLE_WIDTH = 200; +static LLDefaultChildRegistry::Register r("console"); + LLConsole::LLConsole(const LLConsole::Params& p) : LLUICtrl(p), LLFixedBuffer(p.max_lines), diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index bac5491943..596b3a3e70 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -137,6 +137,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mPanelSpacing(p.border_size), mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL), mAnimate(p.animate), + mAnimatedThisFrame(false), mClip(p.clip) {} @@ -172,6 +173,7 @@ void LLLayoutStack::draw() // only force drawing invisible children if visible amount is non-zero drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } + mAnimatedThisFrame = false; } void LLLayoutStack::removeChild(LLView* view) @@ -411,8 +413,10 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au } } +static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { + LLFastTimer ft(FTM_UPDATE_LAYOUT); static LLUICachedControl resize_bar_overlap ("UIResizeBarOverlap", 0); calcMinExtents(); @@ -431,10 +435,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (mAnimate) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); - if ((*panel_it)->mVisibleAmt > 0.99f) + if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = 1.f; + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); + if ((*panel_it)->mVisibleAmt > 0.99f) + { + (*panel_it)->mVisibleAmt = 1.f; + } } } else @@ -446,10 +453,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (mAnimate) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); - if ((*panel_it)->mVisibleAmt < 0.001f) + if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = 0.f; + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + if ((*panel_it)->mVisibleAmt < 0.001f) + { + (*panel_it)->mVisibleAmt = 0.f; + } } } else @@ -631,10 +641,10 @@ void LLLayoutStack::updateLayout(BOOL force_resize) // adjust running headroom count based on new sizes shrink_headroom_total += delta_size; - panelp->reshape(new_width, new_height); - panelp->setOrigin(cur_x, cur_y - new_height); + LLRect panel_rect; + panel_rect.setLeftTopAndSize(cur_x, cur_y, new_width, new_height); + panelp->setShape(panel_rect); - LLRect panel_rect = panelp->getRect(); LLRect resize_bar_rect = panel_rect; if (mOrientation == HORIZONTAL) { @@ -705,6 +715,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) llassert_always(force_resize == FALSE); updateLayout(TRUE); } + + mAnimatedThisFrame = true; } // end LLLayoutStack::updateLayout @@ -772,3 +784,16 @@ void LLLayoutStack::calcMinExtents() } } } + +// update layout stack animations, etc. once per frame +// NOTE: we use this to size world view based on animating UI, *before* we draw the UI +// we might still need to call updateLayout during UI draw phase, in case UI elements +// are resizing themselves dynamically +//static +void LLLayoutStack::idle() +{ + for (LLInstanceTracker::instance_iter it = beginInstances(); it != endInstances(); ++it) + { + (*it)->updateLayout(); + } +} diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 9ded48ef6a..11d604b7ec 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -38,7 +38,7 @@ class LLPanel; -class LLLayoutStack : public LLView +class LLLayoutStack : public LLView, LLInstanceTracker { public: struct Params : public LLInitParam::Block @@ -81,6 +81,10 @@ public: S32 getNumPanels() { return mPanels.size(); } void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); + + + static void idle(); + protected: LLLayoutStack(const Params&); friend class LLUICtrlFactory; @@ -105,6 +109,8 @@ private: S32 mMinHeight; // calculated by calcMinExtents S32 mPanelSpacing; + // true if we already applied animation this frame + bool mAnimatedThisFrame; bool mAnimate; bool mClip; }; // end class LLLayoutStack diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 17e32dc7a9..0ccd3047f6 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -188,7 +188,7 @@ public: T* widget = new T(params); widget->initFromParams(params); if (parent) - widget->setParent(parent); + parent->addChild(widget); return widget; } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index fe7fd59de8..da564befa9 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1698,8 +1698,11 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return child; } +static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); + LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { + LLFastTimer ft(FTM_FIND_VIEWS); //richard: should we allow empty names? //if(name.empty()) // return NULL; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index c3b442e022..2607120e17 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -267,9 +267,6 @@ public: // remove the specified child from the view, and set it's parent to NULL. virtual void removeChild(LLView* view); - // helper function for lluictrlfactory.h create<> template - void setParent(LLView* parent) { if (parent) parent->addChild(this); } - virtual BOOL postBuild() { return TRUE; } child_tab_order_t getCtrlOrder() const { return mCtrlOrder; } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 2ab17d6220..71265fdd2f 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -256,7 +256,8 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) LLToolTipMgr::instance().show(LLToolTip::Params() .message(mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex)) - .sticky_rect(screen_rect)); + .sticky_rect(screen_rect) + .delay_time(0.f)); return TRUE; } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 347cc3a58e..e570072803 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2044,10 +2044,12 @@ BOOL LLFloaterSnapshot::postBuild() LLSnapshotLivePreview::Params p; p.rect(full_screen_rect); LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - getRootView()->removeChild(gSnapshotFloaterView); + LLView* parent_view = gSnapshotFloaterView->getParent(); + + parent_view->removeChild(gSnapshotFloaterView); // make sure preview is below snapshot floater - getRootView()->addChild(previewp); - getRootView()->addChild(gSnapshotFloaterView); + parent_view->addChild(previewp); + parent_view->addChild(gSnapshotFloaterView); //move snapshot floater to special purpose snapshotfloaterview gFloaterView->removeChild(this); diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index b052087475..e3ba1b8e4a 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -677,7 +677,7 @@ void LLPanelStandStopFlying::updatePosition() //align centers of a button and a floater S32 x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2; - S32 y = tray->getRect().getHeight(); + S32 y = 0; LLFloater *move_floater = LLFloaterReg::findInstance("moveview"); if (move_floater) diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 4f145891ea..d37236aadf 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -587,6 +587,8 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + // propagate size to parent container + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -600,6 +602,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } else @@ -614,6 +617,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -626,16 +630,12 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } childSetVisible("bg_icon", fpVisible); childSetVisible("bg_icon_no_fav", !fpVisible); - - if(LLSideTray::instanceCreated()) - { - LLSideTray::getInstance()->resetPanelRect(); - } } void LLNavigationBar::showFavoritesPanel(BOOL visible) @@ -670,6 +670,7 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -694,14 +695,11 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } childSetVisible("bg_icon", visible); childSetVisible("bg_icon_no_fav", !visible); fb->setVisible(visible); - if(LLSideTray::instanceCreated()) - { - LLSideTray::getInstance()->resetPanelRect(); - } } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 65a7b5322b..e0b0b0f1e2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -198,7 +198,8 @@ public: ~LLFriendListUpdater() { - delete mInvObserver; + // will be deleted by ~LLInventoryModel + //delete mInvObserver; LLVoiceClient::getInstance()->removeObserver(this); LLAvatarTracker::instance().removeObserver(this); } diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index aaf6849fe9..7dea5eaf67 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -64,7 +64,6 @@ void ContextMenu::show(LLView* spawning_view, const std::vector& uuids, if (parent) { parent->removeChild(mMenu); - mMenu->setParent(NULL); } delete mMenu; mMenu = NULL; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 0b2a7e8756..f82593822d 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -694,6 +694,7 @@ bool LLPanelPrimMediaControls::isMouseOver() LLView* controls_view = NULL; controls_view = getChild("media_controls"); + //FIXME: rewrite as LLViewQuery or get hover set from LLViewerWindow? if(controls_view && controls_view->getVisible()) { controls_view->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index a34f029095..d094f22ae1 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -163,7 +163,6 @@ void LLTeleportHistoryPanel::ContextMenu::show(LLView* spawning_view, S32 index, if (parent) { parent->removeChild(mMenu); - mMenu->setParent(NULL); } delete mMenu; } @@ -645,7 +644,6 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y if (parent) { parent->removeChild(mAccordionTabMenu); - mAccordionTabMenu->setParent(NULL); } delete mAccordionTabMenu; } diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index a11ee05532..f0e782d44d 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -100,7 +100,7 @@ LLSideTray* LLSideTray::getInstance() { if (!sInstance) { - sInstance = LLUICtrlFactory::createFromFile("panel_side_tray.xml",gViewerWindow->getRootView(), LLRootView::child_registry_t::instance()); + sInstance = LLUICtrlFactory::createFromFile("panel_side_tray.xml",NULL, LLRootView::child_registry_t::instance()); } return sInstance; @@ -148,7 +148,6 @@ public: /*virtual*/ bool addChild (LLView* view, S32 tab_group); - void arrange (S32 width, S32 height); void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); static LLSideTrayTab* createInstance (); @@ -156,8 +155,6 @@ public: const std::string& getDescription () const { return mDescription;} const std::string& getTabTitle() const { return mTabTitle;} - void draw(); - void onOpen (const LLSD& key); private: @@ -209,60 +206,24 @@ BOOL LLSideTrayTab::postBuild() static const S32 splitter_margin = 1; -//virtual -void LLSideTrayTab::arrange(S32 width, S32 height ) -{ - if(!mMainPanel) - return; - - S32 offset = 0; - - LLView* title_panel = findChildView(TAB_PANEL_CAPTION_NAME, true); - - if(title_panel) - { - title_panel->setOrigin( 0, height - title_panel->getRect().getHeight() ); - offset = title_panel->getRect().getHeight(); - } - - LLRect sRect = mMainPanel->getRect(); - sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - mMainPanel->reshape(sRect.getWidth(),sRect.getHeight()); - mMainPanel->setRect(sRect); - - - -} - void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) { - if(!mMainPanel) - return; - S32 offset = 0; - + LLPanel::reshape(width, height, called_from_parent); LLView* title_panel = findChildView(TAB_PANEL_CAPTION_NAME, true); - - if(title_panel) + if (!title_panel) { - title_panel->setOrigin( 0, height - title_panel->getRect().getHeight() ); - title_panel->reshape(width,title_panel->getRect().getHeight()); - offset = title_panel->getRect().getHeight(); + // not fully constructed yet + return; } - - - LLRect sRect = mMainPanel->getRect(); - sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - //mMainPanel->setMaxWidth(sRect.getWidth()); - mMainPanel->reshape(sRect.getWidth(), sRect.getHeight()); - - mMainPanel->setRect(sRect); - -} + S32 title_height = title_panel->getRect().getHeight(); + title_panel->setOrigin( 0, height - title_height ); + title_panel->reshape(width,title_height); -void LLSideTrayTab::draw() -{ - LLPanel::draw(); + LLRect sRect; + sRect.setLeftTopAndSize( splitter_margin, height - title_height - splitter_margin, + width - 2*splitter_margin, height - title_height - 2*splitter_margin); + mMainPanel->setShape(sRect); } void LLSideTrayTab::onOpen (const LLSD& key) @@ -300,17 +261,20 @@ LLSideTray::LLSideTray(Params& params) ,mActiveTab(0) ,mCollapsed(false) ,mCollapseButton(0) - ,mMaxBarWidth(params.rect.width) { mCollapsed=params.collapsed; - LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar(); // register handler function to process data from the xml. // panel_name should be specified via "parameter" attribute. commit.add("SideTray.ShowPanel", boost::bind(&LLSideTray::showPanel, this, _2, LLUUID::null)); LLTransientFloaterMgr::getInstance()->addControlView(this); + + LLPanel::Params p; + p.name = "buttons_panel"; + p.mouse_opaque = false; + mButtonsPanel = LLUICtrlFactory::create(p); } @@ -399,7 +363,7 @@ LLButton* LLSideTray::createButton (const std::string& name,const std::string& i rect.setOriginAndSize(0, 0, sidetray_params.default_button_width, sidetray_params.default_button_height); bparams.name(name); - bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_BOTTOM); + bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); bparams.rect (rect); bparams.tab_stop(false); bparams.image_unselected.name(sidetray_params.tab_btn_image_normal); @@ -416,7 +380,7 @@ LLButton* LLSideTray::createButton (const std::string& name,const std::string& i button->setImageOverlay(image); } - addChildInBack(button); + mButtonsPanel->addChildInBack(button); return button; } @@ -500,23 +464,24 @@ void LLSideTray::reflectCollapseChange() } else { - gFloaterView->setSnapOffsetRight(mMaxBarWidth); + gFloaterView->setSnapOffsetRight(getRect().getWidth()); setFocus(TRUE); } gFloaterView->refresh(); } -void LLSideTray::arrange () +void LLSideTray::arrange() { static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); setPanelRect(); LLRect ctrl_rect; - ctrl_rect.setLeftTopAndSize(0,getRect().getHeight()-sidetray_params.default_button_width - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); + ctrl_rect.setLeftTopAndSize(0, + mButtonsPanel->getRect().getHeight() - sidetray_params.default_button_width, + sidetray_params.default_button_width, + sidetray_params.default_button_height); mCollapseButton->setRect(ctrl_rect); @@ -528,9 +493,10 @@ void LLSideTray::arrange () { LLSideTrayTab* sidebar_tab = *child_it; - ctrl_rect.setLeftTopAndSize(0,getRect().getHeight()-offset - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); + ctrl_rect.setLeftTopAndSize(0, + mButtonsPanel->getRect().getHeight()-offset, + sidetray_params.default_button_width, + sidetray_params.default_button_height); if(mTabButtons.find(sidebar_tab->getName()) == mTabButtons.end()) continue; @@ -544,14 +510,11 @@ void LLSideTray::arrange () btn->setVisible(ctrl_rect.mBottom > 0); } - ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); - //arrange tabs - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + for ( child_vector_t::iterator child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) { LLSideTrayTab* sidebar_tab = *child_it; - sidebar_tab->setRect(ctrl_rect); - sidebar_tab->arrange(mMaxBarWidth,getRect().getHeight()); + sidebar_tab->setShape(getLocalRect()); } } @@ -580,7 +543,7 @@ void LLSideTray::collapseSideBar() { mCollapseButton->setImageOverlay( home_tab->mImage ); } - mActiveTab->setVisible(FALSE); + //mActiveTab->setVisible(FALSE); reflectCollapseChange(); setFocus( FALSE ); @@ -596,7 +559,6 @@ void LLSideTray::expandSideBar() } LLSD key;//empty mActiveTab->onOpen(key); - mActiveTab->setVisible(TRUE); reflectCollapseChange(); } @@ -612,15 +574,6 @@ void LLSideTray::highlightFocused() */ } -BOOL LLSideTray::handleScrollWheel(S32 x, S32 y, S32 mask) -{ - BOOL ret = LLPanel::handleScrollWheel(x,y,mask); - - if(!ret && childFromPoint(x,y) != 0 ) - return TRUE;//mouse wheel over sidetray buttons, eat mouse wheel - return ret; -} - //virtual BOOL LLSideTray::handleMouseDown (S32 x, S32 y, MASK mask) { @@ -630,58 +583,13 @@ BOOL LLSideTray::handleMouseDown (S32 x, S32 y, MASK mask) return ret; } -void LLSideTray::reshape (S32 width, S32 height, BOOL called_from_parent) +void LLSideTray::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLPanel::reshape(width, height, called_from_parent); if(!mActiveTab) return; - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); - - setPanelRect(); - - LLRect ctrl_rect; - ctrl_rect.setLeftTopAndSize(0 - ,getRect().getHeight()-sidetray_params.default_button_width - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); - - mCollapseButton->setRect(ctrl_rect); - - //arrange tab buttons - child_vector_const_iter_t child_it; - int offset = (sidetray_params.default_button_height+sidetray_params.default_button_margin)*2; - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) - { - LLSideTrayTab* sidebar_tab = *child_it; - - ctrl_rect.setLeftTopAndSize(0,getRect().getHeight()-offset - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); - - if(mTabButtons.find(sidebar_tab->getName()) == mTabButtons.end()) - continue; - - LLButton* btn = mTabButtons[sidebar_tab->getName()]; - - btn->setRect(ctrl_rect); - offset+=sidetray_params.default_button_height; - offset+=sidetray_params.default_button_margin; - - btn->setVisible(ctrl_rect.mBottom > 0); - } - - //arrange tabs - - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) - { - LLSideTrayTab* sidebar_tab = *child_it; - sidebar_tab->reshape(mMaxBarWidth,getRect().getHeight()); - ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); - sidebar_tab->setRect(ctrl_rect); - - } + arrange(); } /** @@ -729,42 +637,12 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; -void LLSideTray::resetPanelRect () -{ - const LLRect& parent_rect = gViewerWindow->getRootView()->getRect(); - - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); - - S32 panel_width = sidetray_params.default_button_width; - panel_width += mCollapsed ? 0 : mMaxBarWidth; - - S32 panel_height = parent_rect.getHeight()-fake_top_offset; - - reshape(panel_width,panel_height); -} - void LLSideTray::setPanelRect () { - LLNavigationBar* nav_bar = LLNavigationBar::getInstance(); - LLRect nav_rect = nav_bar->getRect(); - - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); - - const LLRect& parent_rect = gViewerWindow->getRootView()->getRect(); - - S32 panel_width = sidetray_params.default_button_width; - panel_width += mCollapsed ? 0 : mMaxBarWidth; - - S32 panel_height = parent_rect.getHeight()-fake_top_offset - nav_rect.getHeight(); - S32 panel_top = parent_rect.mTop-fake_top_offset - nav_rect.getHeight(); - - LLRect panel_rect; - panel_rect.setLeftTopAndSize( parent_rect.mRight-panel_width, panel_top, panel_width, panel_height); - setRect(panel_rect); + // set visibility of parent container based on collapsed state + if (getParent()) + { + getParent()->setVisible(!mCollapsed); + } } -S32 LLSideTray::getTrayWidth() -{ - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); - return getRect().getWidth() - (sidetray_params.default_button_width + sidetray_params.default_button_margin); -} diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index b49251ec79..72a9465baa 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -118,6 +118,8 @@ public: LLPanel::setVisible(visible); } + LLPanel* getButtonsPanel() { return mButtonsPanel; } + public: virtual ~LLSideTray(){}; @@ -129,10 +131,8 @@ public: bool addChild (LLView* view, S32 tab_group); BOOL handleMouseDown (S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 mask); void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); - S32 getTrayWidth(); void resetPanelRect (); @@ -163,15 +163,15 @@ private: private: - std::map mTabButtons; + LLPanel* mButtonsPanel; + typedef std::map button_map_t; + button_map_t mTabButtons; child_vector_t mTabs; LLSideTrayTab* mActiveTab; LLButton* mCollapseButton; bool mCollapsed; - S32 mMaxBarWidth; - static LLSideTray* sInstance; }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8630369971..b15019f830 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1405,6 +1405,9 @@ void LLViewerWindow::initBase() main_view->setShape(full_window); getRootView()->addChild(main_view); + // placeholder widget that controls where "world" is rendered + mWorldViewPlaceholder = main_view->getChildView("world_view_rect"); + // Constrain floaters to inside the menu and status bar regions. gFloaterView = getRootView()->getChild("Floater View"); gSnapshotFloaterView = getRootView()->getChild("Snapshot Floater View"); @@ -1458,9 +1461,6 @@ void LLViewerWindow::initWorldUI() gIMMgr = LLIMMgr::getInstance(); - // side tray - //getRootView()->addChild(LLSideTray::getInstance()); - getRootView()->sendChildToFront(gFloaterView); getRootView()->sendChildToFront(gSnapshotFloaterView); @@ -1468,7 +1468,7 @@ void LLViewerWindow::initWorldUI() LLPanel* bottom_tray_container = getRootView()->getChild("bottom_tray_container"); LLBottomTray* bottom_tray = LLBottomTray::getInstance(); bottom_tray->setShape(bottom_tray_container->getLocalRect()); - bottom_tray->setFollows(FOLLOWS_ALL); + bottom_tray->setFollowsAll(); bottom_tray_container->addChild(bottom_tray); bottom_tray_container->setVisible(TRUE); @@ -1498,7 +1498,8 @@ void LLViewerWindow::initWorldUI() // Status bar LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); gStatusBar = new LLStatusBar(status_bar_container->getLocalRect()); - gStatusBar->setFollows(FOLLOWS_ALL); + gStatusBar->setFollowsAll(); + gStatusBar->setShape(status_bar_container->getLocalRect()); // sync bg color with menu bar gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() ); status_bar_container->addChild(gStatusBar); @@ -1559,10 +1560,24 @@ void LLViewerWindow::initWorldUI() LLPanel* panel_ssf_container = getRootView()->getChild("stand_stop_flying_container"); LLPanelStandStopFlying* panel_stand_stop_flying = LLPanelStandStopFlying::getInstance(); panel_stand_stop_flying->setShape(panel_ssf_container->getLocalRect()); - panel_stand_stop_flying->setFollows(FOLLOWS_ALL); + panel_stand_stop_flying->setFollowsAll(); panel_ssf_container->addChild(panel_stand_stop_flying); panel_ssf_container->setVisible(TRUE); + // put sidetray in container + LLPanel* side_tray_container = getRootView()->getChild("side_tray_container"); + LLSideTray* sidetrayp = LLSideTray::getInstance(); + sidetrayp->setShape(side_tray_container->getLocalRect()); + sidetrayp->setFollowsAll(); + side_tray_container->addChild(sidetrayp); + side_tray_container->setVisible(FALSE); + + // put sidetray buttons in their own panel + LLPanel* buttons_panel = sidetrayp->getButtonsPanel(); + LLPanel* buttons_panel_container = getRootView()->getChild("side_bar_tabs"); + buttons_panel->setShape(buttons_panel_container->getLocalRect()); + buttons_panel->setFollowsAll(); + buttons_panel_container->addChild(buttons_panel); } // Destroy the UI @@ -2272,29 +2287,6 @@ void LLViewerWindow::moveCursorToCenter() LLUI::setMousePositionScreen(x, y); } -void LLViewerWindow::updateBottomTrayRect() -{ - //if(LLBottomTray::instanceExists() && LLSideTray::instanceCreated()) - //{ - // S32 side_tray_width = 0; - // if(LLSideTray::getInstance()->getVisible()) - // { - // side_tray_width = LLSideTray::getInstance()->getTrayWidth(); - // } - - // LLBottomTray* bottom_tray = LLBottomTray::getInstance(); - // S32 right = llround((F32)mWindowRect.mRight / mDisplayScale.mV[VX]) - side_tray_width; - - // LLRect rc = bottom_tray->getRect(); - // if (right != rc.mRight) - // { - // rc.mRight = right; - // bottom_tray->reshape(rc.getWidth(), rc.getHeight(), FALSE); - // bottom_tray->setRect(rc); - // mOnBottomTrayWidthChanged(); - // } - //} -} ////////////////////////////////////////////////////////////////////// // @@ -2336,9 +2328,10 @@ void LLViewerWindow::updateUI() { static std::string last_handle_msg; - updateWorldViewRect(); + // animate layout stacks so we have up to date rect for world view + LLLayoutStack::idle(); - updateBottomTrayRect(); + updateWorldViewRect(); LLView::sMouseHandlerMessage.clear(); @@ -2838,32 +2831,20 @@ void LLViewerWindow::updateKeyboardFocus() LLSideTray::getInstance()->highlightFocused(); } +static LLFastTimer::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View"); void LLViewerWindow::updateWorldViewRect(bool use_full_window) { - if (!LLSideTray::instanceCreated()) return; + LLFastTimer ft(FTM_UPDATE_WORLD_VIEW); // start off using whole window to render world LLRect new_world_rect = mWindowRect; if (use_full_window == false) { - // pull in right side of world view based on sidetray - LLSideTray* sidetray = LLSideTray::getInstance(); - if (sidetray->getVisible()) - { - new_world_rect.mRight -= llround((F32)sidetray->getTrayWidth() * mDisplayScale.mV[VX]); - } - - // push top of world view below nav bar - if (LLNavigationBar::getInstance()->getVisible()) - { - LLNavigationBar* barp = LLNavigationBar::getInstance(); - LLRect nav_bar_rect; - if(barp->localRectToOtherView(barp->getLocalRect(), &nav_bar_rect, mRootView)) - { - new_world_rect.mTop = llround((F32)LLNavigationBar::getInstance()->getRect().mBottom * mDisplayScale.mV[VY]); - } - } + new_world_rect = mWorldViewPlaceholder->calcScreenRect(); + // clamp to at least a 1x1 rect so we don't try to allocate zero width gl buffers + new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1); + new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1); } if (mWorldViewRect != new_world_rect) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d7c403739e..31a458a15b 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -294,7 +294,6 @@ public: void updateKeyboardFocus(); void updateWorldViewRect(bool use_full_window=false); - void updateBottomTrayRect(); BOOL handleKey(KEY key, MASK mask); void handleScrollWheel (S32 clicks); @@ -451,6 +450,8 @@ protected: BOOL mIgnoreActivate; std::string mInitAlert; // Window / GL initialization requires an alert + + LLView* mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world class LLDebugText* mDebugText; // Internal class for debug text diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0dc1a88ee8..eac83c0bdc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -506,8 +506,10 @@ void LLPipeline::destroyGL() } } +static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); void LLPipeline::resizeScreenTexture() { + LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); if (gPipeline.canUseVertexShaders() && assertInitialized()) { GLuint resX = gViewerWindow->getWorldViewWidth(); diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 2d69465b58..08f7ee456e 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -1,119 +1,130 @@ - + orientation="vertical" + top="0"> - - - - - - + + - - + + + - - - - - - - - - - - + + + + + + + + - + name="Floater View" + tab_group="-1" + tab_stop="false" + top="0" + width="1024"/> + + + @@ -44,7 +45,7 @@ min_height="23" width="310" top="0" - min_width="300" + min_width="310" name="chat_bar" user_resize="false" filename="panel_nearby_chat_bar.xml" /> @@ -57,30 +58,31 @@ min_height="28" width="100" top_delta="0" - min_width="96" + min_width="100" name="speak_panel" user_resize="false"> - + - + @@ -149,6 +152,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -188,6 +192,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -243,6 +248,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" top="0" width="5"/> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 7b9c9f47a2..1171a8f0b5 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -3,7 +3,7 @@ background_opaque="true" background_visible="true" bg_opaque_color="MouseGray" - follows="top|left|right" + follows="all" height="19" layout="topleft" left="0" diff --git a/indra/newview/skins/default/xui/en/widgets/context_menu.xml b/indra/newview/skins/default/xui/en/widgets/context_menu.xml new file mode 100644 index 0000000000..459706c689 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/context_menu.xml @@ -0,0 +1,2 @@ + + diff --git a/indra/newview/skins/default/xui/en/widgets/side_tray.xml b/indra/newview/skins/default/xui/en/widgets/side_tray.xml index 8b4a5afbe9..022564c12f 100644 --- a/indra/newview/skins/default/xui/en/widgets/side_tray.xml +++ b/indra/newview/skins/default/xui/en/widgets/side_tray.xml @@ -1,8 +1,7 @@ + tab_btn_image_selected="TaskPanel_Tab_Selected" + tab_btn_width="32" + tab_btn_height="40" + tab_btn_margin="1"> diff --git a/indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml b/indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml new file mode 100644 index 0000000000..48950a98ad --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml @@ -0,0 +1,2 @@ + + -- cgit v1.3 From 2bc97bd68a774dd373c5688b5dc660abe90b37cc Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 9 Nov 2009 16:01:21 -0800 Subject: renamed LLLayoutStack::idle to LLLayoutStack::updateClass converted mWorldViewPlaceholder to a LLHandle improved layout of panel_bottomtray reviewed by James --- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/lllayoutstack.h | 2 +- indra/newview/llsidetray.cpp | 6 +++--- indra/newview/llsidetray.h | 5 +---- indra/newview/llviewerwindow.cpp | 8 ++++---- indra/newview/llviewerwindow.h | 2 +- indra/newview/skins/default/xui/en/panel_bottomtray.xml | 4 ++-- 7 files changed, 13 insertions(+), 16 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 596b3a3e70..5999e1a29e 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -790,7 +790,7 @@ void LLLayoutStack::calcMinExtents() // we might still need to call updateLayout during UI draw phase, in case UI elements // are resizing themselves dynamically //static -void LLLayoutStack::idle() +void LLLayoutStack::updateClass() { for (LLInstanceTracker::instance_iter it = beginInstances(); it != endInstances(); ++it) { diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 11d604b7ec..8475079f5e 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -83,7 +83,7 @@ public: void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); - static void idle(); + static void updateClass(); protected: LLLayoutStack(const Params&); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index f0e782d44d..061587f11b 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -455,7 +455,7 @@ void LLSideTray::onToggleCollapse() void LLSideTray::reflectCollapseChange() { - setPanelRect(); + updateSidetrayVisibility(); if(mCollapsed) { @@ -475,7 +475,7 @@ void LLSideTray::arrange() { static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams()); - setPanelRect(); + updateSidetrayVisibility(); LLRect ctrl_rect; ctrl_rect.setLeftTopAndSize(0, @@ -637,7 +637,7 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; -void LLSideTray::setPanelRect () +void LLSideTray::updateSidetrayVisibility() { // set visibility of parent container based on collapsed state if (getParent()) diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 72a9465baa..4d6081e230 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -134,9 +134,6 @@ public: void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); - void resetPanelRect (); - - protected: LLSideTrayTab* getTab (const std::string& name); @@ -147,7 +144,7 @@ protected: void toggleTabButton (LLSideTrayTab* tab); - void setPanelRect (); + void updateSidetrayVisibility(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b15019f830..5e5aec5cb9 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1406,7 +1406,7 @@ void LLViewerWindow::initBase() getRootView()->addChild(main_view); // placeholder widget that controls where "world" is rendered - mWorldViewPlaceholder = main_view->getChildView("world_view_rect"); + mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle(); // Constrain floaters to inside the menu and status bar regions. gFloaterView = getRootView()->getChild("Floater View"); @@ -2329,7 +2329,7 @@ void LLViewerWindow::updateUI() static std::string last_handle_msg; // animate layout stacks so we have up to date rect for world view - LLLayoutStack::idle(); + LLLayoutStack::updateClass(); updateWorldViewRect(); @@ -2839,9 +2839,9 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window) // start off using whole window to render world LLRect new_world_rect = mWindowRect; - if (use_full_window == false) + if (use_full_window == false && mWorldViewPlaceholder.get()) { - new_world_rect = mWorldViewPlaceholder->calcScreenRect(); + new_world_rect = mWorldViewPlaceholder.get()->calcScreenRect(); // clamp to at least a 1x1 rect so we don't try to allocate zero width gl buffers new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1); new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 31a458a15b..6750c39dbb 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -451,7 +451,7 @@ protected: std::string mInitAlert; // Window / GL initialization requires an alert - LLView* mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world + LLHandle mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world class LLDebugText* mDebugText; // Internal class for debug text diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index faa38084f1..d990ebfd4a 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -56,9 +56,9 @@ height="28" layout="topleft" min_height="28" - width="100" + width="104" top_delta="0" - min_width="100" + min_width="104" name="speak_panel" user_resize="false">