diff options
41 files changed, 443 insertions, 430 deletions
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<LLConsole> r("console"); + LLConsole::LLConsole(const LLConsole::Params& p) : LLUICtrl(p), LLFixedBuffer(p.max_lines), 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<LLFloaterView> r("floater_view"); + LLFloaterView::LLFloaterView (const Params& p) : LLUICtrl (p), mFocusCycleMode(FALSE), diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index bac5491943..5999e1a29e 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<S32> 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::updateClass() +{ + 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..8475079f5e 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<LLLayoutStack> { public: struct Params : public LLInitParam::Block<Params, LLView::Params> @@ -81,6 +81,10 @@ public: S32 getNumPanels() { return mPanels.size(); } void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); + + + static void updateClass(); + 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/llmenugl.cpp b/indra/llui/llmenugl.cpp index c6a38c7ca7..de9a854f63 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3270,11 +3270,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 dc8ed3b3fd..cbb9b4d344 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -746,7 +746,9 @@ private: class LLMenuHolderGL : public LLPanel { public: - LLMenuHolderGL(); + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + {}; + LLMenuHolderGL(const Params& p); virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); 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<LLScrollColumnHeader>()); params.name = "btn_" + name; params.rect = temp_rect; params.column = new_column; 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<LLToolTipView> register_tooltip_view("tooltip_view"); + LLToolTipView::Params::Params() { mouse_opaque = false; @@ -142,7 +144,7 @@ void LLToolTipView::drawStickyRect() // -static LLDefaultChildRegistry::Register<LLToolTip> r("tool_tip"); +static LLDefaultChildRegistry::Register<LLToolTip> register_tooltip("tool_tip"); LLToolTip::Params::Params() 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 f9b4a6b73d..dba24ee165 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1697,8 +1697,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/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index e5cc2fce88..832694873f 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -70,7 +70,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/llchiclet.cpp b/indra/newview/llchiclet.cpp index 53c4bb32ca..c200a97058 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -812,6 +812,8 @@ LLChicletPanel::LLChicletPanel(const Params&p) LLChicletPanel::~LLChicletPanel() { + LLTransientFloaterMgr::getInstance()->removeControlView(mLeftScrollButton); + LLTransientFloaterMgr::getInstance()->removeControlView(mRightScrollButton); } diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 9057d84f63..f76ec396ac 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -55,12 +55,16 @@ LLDebugView* gDebugView = NULL; // // Methods // +static LLDefaultChildRegistry::Register<LLDebugView> 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/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 fd2e7b3487..e570072803 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<LLSnapshotFloaterView> r("snapshot_floater_view"); + ///---------------------------------------------------------------------------- /// Class LLSnapshotLivePreview ///---------------------------------------------------------------------------- @@ -2042,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 14da35594f..e3ba1b8e4a 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; @@ -680,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 63794be085..17b712bc5e 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -586,6 +586,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); @@ -599,6 +601,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } else @@ -613,6 +616,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); @@ -625,16 +629,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) @@ -669,6 +669,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); @@ -693,14 +694,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 0c66e7155c..a6083a5755 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<LLUUID>& 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 73e19b3b2a..d33fcc5512 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -697,6 +697,7 @@ bool LLPanelPrimMediaControls::isMouseOver() LLView* controls_view = NULL; controls_view = getChild<LLView>("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 72856d5b82..057cdde6f0 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; } @@ -658,7 +657,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..061587f11b 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -100,7 +100,7 @@ LLSideTray* LLSideTray::getInstance() { if (!sInstance) { - sInstance = LLUICtrlFactory::createFromFile<LLSideTray>("panel_side_tray.xml",gViewerWindow->getRootView(), LLRootView::child_registry_t::instance()); + sInstance = LLUICtrlFactory::createFromFile<LLSideTray>("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<LLPanel>(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; } @@ -491,7 +455,7 @@ void LLSideTray::onToggleCollapse() void LLSideTray::reflectCollapseChange() { - setPanelRect(); + updateSidetrayVisibility(); if(mCollapsed) { @@ -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<LLSideTray>()); - setPanelRect(); + updateSidetrayVisibility(); 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<LLSideTray>()); - - 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<LLSideTray>()); - - 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 () +void LLSideTray::updateSidetrayVisibility() { - LLNavigationBar* nav_bar = LLNavigationBar::getInstance(); - LLRect nav_rect = nav_bar->getRect(); - - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - - 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<LLSideTray>()); - 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..4d6081e230 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,13 +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 (); - protected: LLSideTrayTab* getTab (const std::string& name); @@ -147,7 +144,7 @@ protected: void toggleTabButton (LLSideTrayTab* tab); - void setPanelRect (); + void updateSidetrayVisibility(); @@ -163,15 +160,15 @@ private: private: - std::map<std::string,LLButton*> mTabButtons; + LLPanel* mButtonsPanel; + typedef std::map<std::string,LLButton*> 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/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index d441762fa6..57ea018f25 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -129,6 +129,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) LLSpeakButton::~LLSpeakButton() { + LLTransientFloaterMgr::getInstance()->removeControlView(mSpeakBtn); + LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn); } void LLSpeakButton::onMouseDown_SpeakBtn() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index cb1be5fabc..97879046a0 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -468,16 +468,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(); @@ -7078,6 +7068,11 @@ void handle_test_load_url(void*) // // LLViewerMenuHolderGL // +static LLDefaultChildRegistry::Register<LLViewerMenuHolderGL> r("menu_holder"); + +LLViewerMenuHolderGL::LLViewerMenuHolderGL(const LLViewerMenuHolderGL::Params& p) +: LLMenuHolderGL(p) +{} BOOL LLViewerMenuHolderGL::hideMenus() { @@ -7087,8 +7082,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 db4eb3be9d..9a6fe03f9f 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -133,6 +133,11 @@ void handle_export_selected( void * ); class LLViewerMenuHolderGL : public LLMenuHolderGL { public: + struct Params : public LLInitParam::Block<Params, LLMenuHolderGL::Params> + {}; + + LLViewerMenuHolderGL(const Params& p); + virtual BOOL hideMenus(); void setParcelSelection(LLSafeHandle<LLParcelSelection> selection); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fc09c946af..29ce2510f2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1377,6 +1377,10 @@ void LLViewerWindow::initGLDefaults() gCylinder.prerender(); } +struct MainPanel : public LLPanel +{ +}; + void LLViewerWindow::initBase() { S32 height = getWindowHeight(); @@ -1400,30 +1404,18 @@ 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); + + // placeholder widget that controls where "world" is rendered + mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle(); // 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<LLFloaterView> (fvparams); - - LLSnapshotFloaterView::Params snapParams; - snapParams.name("Snapshot Floater View"); - snapParams.rect(full_window); - snapParams.enabled(false); - gSnapshotFloaterView = LLUICtrlFactory::create<LLSnapshotFloaterView> (snapParams); + gFloaterView = getRootView()->getChild<LLFloaterView>("Floater View"); + gSnapshotFloaterView = getRootView()->getChild<LLSnapshotFloaterView>("Snapshot Floater View"); - // Snapshot floater must start invisible otherwise it eats all - // the tooltips. JC - gSnapshotFloaterView->setVisible(FALSE); - // Console llassert( !gConsole ); LLConsole::Params cp; @@ -1447,43 +1439,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<LLDebugView>(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<LLNotifyBoxView> (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<LLToolTipView>(hvp); - gToolTipView->setFollowsAll(); - getRootView()->addChild(gToolTipView); + gDebugView = getRootView()->getChild<LLDebugView>("DebugView"); + gDebugView->init(); + gNotifyBoxView = getRootView()->getChild<LLNotifyBoxView>("notify_container"); + gToolTipView = getRootView()->getChild<LLToolTipView>("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<LLViewerMenuHolderGL>("Menu Holder"); + + LLMenuGL::sMenuContainer = gMenuHolder; + } void LLViewerWindow::initWorldUI() @@ -1492,20 +1462,19 @@ void LLViewerWindow::initWorldUI() S32 width = mRootView->getRect().getWidth(); LLRect full_window(0, height, width, 0); - gIMMgr = LLIMMgr::getInstance(); - // side tray - getRootView()->addChild(LLSideTray::getInstance()); + gIMMgr = LLIMMgr::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<LLPanel>("bottom_tray_container"); + LLBottomTray* bottom_tray = LLBottomTray::getInstance(); + bottom_tray->setShape(bottom_tray_container->getLocalRect()); + bottom_tray->setFollowsAll(); + 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 @@ -1521,17 +1490,6 @@ void LLViewerWindow::initWorldUI() gMorphView = LLUICtrlFactory::create<LLMorphView>(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 @@ -1542,22 +1500,23 @@ 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<LLPanel>("status_bar_container"); + gStatusBar = new LLStatusBar(status_bar_container->getLocalRect()); + gStatusBar->setFollowsAll(); + gStatusBar->setShape(status_bar_container->getLocalRect()); // 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<LLPanel>("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")) { @@ -1589,19 +1548,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; @@ -1615,11 +1561,27 @@ 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(); - - // tooltips are always on top - getRootView()->sendChildToFront(gToolTipView); + LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container"); + LLPanelStandStopFlying* panel_stand_stop_flying = LLPanelStandStopFlying::getInstance(); + panel_stand_stop_flying->setShape(panel_ssf_container->getLocalRect()); + 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<LLPanel>("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<LLPanel>("side_bar_tabs"); + buttons_panel->setShape(buttons_panel_container->getLocalRect()); + buttons_panel->setFollowsAll(); + buttons_panel_container->addChild(buttons_panel); } // Destroy the UI @@ -2334,29 +2296,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(); - } - } -} ////////////////////////////////////////////////////////////////////// // @@ -2398,9 +2337,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::updateClass(); - updateBottomTrayRect(); + updateWorldViewRect(); LLView::sMouseHandlerMessage.clear(); @@ -2900,32 +2840,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) + if (use_full_window == false && mWorldViewPlaceholder.get()) { - // 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.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); } if (mWorldViewRect != new_world_rect) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index c2906b1718..d8f0a99a49 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 + + LLHandle<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 2daaf77772..ba1732bc92 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/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 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - legacy_header_height="18" - height="440" + height="768" layout="topleft" name="floater_aaa" - help_topic="floater_aaa" - save_rect="true" can_resize="true" - title="ABOUT [APP_NAME]" - width="470"> - <text_editor - follows="left|top|right|bottom" - height="400" - layout="topleft" - left="6" - max_length="65536" - name="credits_editor" - top="25" - width="458" - word_wrap="true"> -This is line 4 - </text_editor> + width="1024"> + <panel filename="main_view.xml" follows="all" width="1024" height="768" top="0"/> </floater> 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..08f7ee456e --- /dev/null +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="left|right|top|bottom" + height="768" + layout="topleft" + left="0" + mouse_opaque="false" + name="main_view" + width="1024"> + <layout_stack border_size="0" + follows="all" + mouse_opaque="false" + height="772" + name="menu_stack" + orientation="vertical" + top="0"> + <layout_panel auto_resize="false" + min_height="19" + mouse_opaque="false" + name="status_bar_container" + height="19" + width="1024" + visible="false"/> + <layout_panel auto_resize="false" + height="65" + mouse_opaque="false" + name="nav_bar_container" + width="1024" + visible="false"/> + <panel auto_resize="true" + follows="all" + height="500" + layout="topleft" + mouse_opaque="false" + name="hud" + width="1024"> + <layout_stack border_size="0" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="hud_stack" + orientation="horizontal" + top="0" + width="1024"> + <panel auto_resize="true" + follows="all" + height="500" + layout="topleft" + mouse_opaque="false" + name="main_view" + user_resize="true" + width="500"> + <layout_stack border_size="0" + bottom="500" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="world_stack" + orientation="vertical"> + <panel auto_resize="true" + follows="all" + height="500" + layout="topleft" + mouse_opaque="false" + name="hud container" + width="500"> + <view bottom="500" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="world_view_rect" + width="500"/> + <panel follows="right|top|bottom" + height="500" + mouse_opaque="false" + name="side_bar_tabs" + right="500" + top="0" + width="32"/> + <panel bottom="500" + follows="left|right|bottom" + height="25" + left="0" + mouse_opaque="false" + name="stand_stop_flying_container" + visible="false" + width="500"/> + </panel> + <layout_panel auto_resize="false" + follows="all" + min_height="33" + mouse_opaque="false" + name="bottom_tray_container" + visible="false"/> + </layout_stack> + </panel> + <!-- side tray --> + <layout_panel auto_resize="false" + follows="all" + height="500" + min_width="333" + mouse_opaque="false" + name="side_tray_container" + user_resize="true" + visible="false" + width="333"/> + </layout_stack> + <floater_view follows="all" + height="500" + left="0" + mouse_opaque="false" + name="Floater View" + tab_group="-1" + tab_stop="false" + top="0" + width="1024"/> + <debug_view follows="all" + left="0" + top="0" + mouse_opaque="false" + height="500" + name="DebugView" + width="1024"/> + </panel> + </layout_stack> + <notify_box_view top="0" + follows="all" + height="768" + mouse_opaque="false" + name="notify_container" + tab_group="-2" + width="1024"/> + <menu_holder top="0" + follows="all" + height="768" + mouse_opaque="false" + name="Menu Holder" + width="1024"/> + <snapshot_floater_view enabled="false" + follows="all" + height="768" + left="0" + mouse_opaque="false" + name="Snapshot Floater View" + tab_stop="false" + top="0" + visible="false" + width="1024"/> + <tooltip_view top="0" + follows="all" + height="768" + mouse_opaque="false" + name="tooltip view" + tab_group="-2" + width="1024"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index c5e129cf2f..3fbc8e1afd 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -31,6 +31,7 @@ height="10" image_name="spacer24.tga" layout="topleft" + min_width="4" left="0" top="0" width="4" /> @@ -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" /> @@ -55,34 +56,35 @@ height="28" layout="topleft" min_height="28" - width="100" + width="104" top_delta="0" - min_width="96" + min_width="104" name="speak_panel" user_resize="false"> - <talk_button - follows="right" - height="23" - speak_button.tab_stop="true" - show_button.tab_stop="true" - layout="topleft" - left="0" - name="talk" - top="3" + <talk_button + follows="right" + height="23" + speak_button.tab_stop="true" + show_button.tab_stop="true" + layout="topleft" + left="0" + name="talk" + top="3" width="100" speak_button.tool_tip="Turns microphone on/off" show_button.tool_tip="Shows/hides voice control panel" /> </layout_panel> - <icon - auto_resize="false" - follows="left|right" - height="10" - image_name="spacer24.tga" - layout="topleft" - left="0" - name="DUMMY" - top="0" - width="4"/> + <icon + auto_resize="false" + follows="left|right" + height="10" + image_name="spacer24.tga" + layout="topleft" + left="0" + name="DUMMY" + min_width="4" + top="0" + width="4"/> <layout_panel mouse_opaque="false" auto_resize="false" @@ -115,6 +117,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -152,6 +155,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -191,6 +195,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -246,6 +251,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" top="0" width="5"/> <layout_panel @@ -291,6 +297,7 @@ height="10" image_name="spacer24.tga" layout="topleft" + min_width="4" right="-1" top="0" width="26"/> diff --git a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml index c8703aa895..b48943c699 100644 --- a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml +++ b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml @@ -5,7 +5,7 @@ layout="topleft" name="panel_stand_stop_flying" mouse_opaque="false" - visible="false" + visible="true" width="115"> <button follows="left|bottom" 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 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<context_menu visible="false"/> diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml new file mode 100644 index 0000000000..0794b49a0c --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<scroll_column_header image_unselected="square_btn_32x128.tga" + image_selected="square_btn_selected_32x128.tga" + image_disabled="square_btn_32x128.tga" + image_disabled_selected="square_btn_selected_32x128.tga" + image_overlay="combobox_arrow.tga" + image_overlay_alignment="right" + halign="left" + scale_image="true"/> 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 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <side_tray tab_btn_image="TaskPanel_Tab_Off" - tab_btn_image_selected="TaskPanel_Tab_Selected" - tab_btn_width="32" - tab_btn_height="40" - tab_btn_margin="1" - > + tab_btn_image_selected="TaskPanel_Tab_Selected" + tab_btn_width="32" + tab_btn_height="40" + tab_btn_margin="1"> </side_tray> 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 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<toggleable_menu visible="false"/> |