From f95922c27330b12ba22434203bf6955c06b74ba4 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 12 Oct 2011 10:08:14 -0700 Subject: Updated tooltip for "picks" to match the wiki. --- indra/newview/skins/default/xui/en/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f19cfa19f2..04fc5c868c 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3695,7 +3695,7 @@ Try enclosing path to the editor with double quotes. Show nearby people Moving your avatar Friends, groups, and nearby people - Favorite places + Places to show as favorites in your profile Places you've saved Preferences Edit or view your profile -- cgit v1.2.3 From ed53295cb3137f757d4d120f84f5d22c170ae823 Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 12 Oct 2011 12:55:37 -0700 Subject: EXP-1322 FIX Stand / Stop Flying button should be centered above the bottom toolbar at all times --- indra/newview/llmoveview.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 2af01d06c1..c3d8b91d67 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -696,25 +696,28 @@ void LLPanelStandStopFlying::updatePosition() { if (mAttached) return; - S32 x = 0; - S32 y = 0; - - if(LLView* root = getRootView()) + S32 y_pos = 0; + S32 bottom_tb_center = 0; + if (LLToolBar* toolbar_bottom = gToolBarView->getChild("toolbar_bottom")) { - x = root->calcScreenRect().getCenterX() - getRect().getWidth()/2; + y_pos = toolbar_bottom->getRect().getHeight(); + bottom_tb_center = toolbar_bottom->getRect().getCenterX(); } - if (LLToolBar* toolbar_bottom = gToolBarView->getChild("toolbar_bottom")) + S32 left_tb_width = 0; + if (LLToolBar* toolbar_left = gToolBarView->getChild("toolbar_left")) { - y = toolbar_bottom->getRect().getHeight(); + left_tb_width = toolbar_left->getRect().getWidth(); } if(LLPanel* panel_ssf_container = getRootView()->getChild("stand_stop_flying_container")) { - panel_ssf_container->setOrigin(0, y); + panel_ssf_container->setOrigin(0, y_pos); } - setOrigin(x, 0); + S32 x_pos = bottom_tb_center-getRect().getWidth()/2 - left_tb_width; + + setOrigin( x_pos, 0); } // EOF -- cgit v1.2.3 From a1f0101ca293768a37889856b1dde69110b30b7c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 13:50:20 -0700 Subject: EXP-1275 WIP A UI element or Keyboard shortcut to clear the viewport restores hidden floaters now --- indra/llui/llfloater.cpp | 46 ++++++++++++++++++++++++++++++++++++++++ indra/llui/llfloater.h | 11 ++++++++-- indra/newview/llviewerwindow.cpp | 6 +++++- 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 0398c0d7eb..4bcc7c6fe0 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2506,6 +2506,52 @@ void LLFloaterView::closeAllChildren(bool app_quitting) } } +void LLFloaterView::hiddenFloaterClosed(LLFloater* floater) +{ + for (hidden_floaters_t::iterator it = mHiddenFloaters.begin(), end_it = mHiddenFloaters.end(); + it != end_it; + ++it) + { + if (it->first.get() == floater) + { + it->second.disconnect(); + mHiddenFloaters.erase(it); + break; + } + } +} + +void LLFloaterView::hideAllFloaters() +{ + child_list_t child_list = *(getChildList()); + + for (child_list_iter_t it = child_list.begin(); it != child_list.end(); ++it) + { + LLFloater* floaterp = dynamic_cast(*it); + if (floaterp && floaterp->getVisible()) + { + floaterp->setVisible(false); + boost::signals2::connection connection = floaterp->mCloseSignal.connect(boost::bind(&LLFloaterView::hiddenFloaterClosed, this, floaterp)); + mHiddenFloaters.push_back(std::make_pair(floaterp->getHandle(), connection)); + } + } +} + +void LLFloaterView::showHiddenFloaters() +{ + for (hidden_floaters_t::iterator it = mHiddenFloaters.begin(), end_it = mHiddenFloaters.end(); + it != end_it; + ++it) + { + LLFloater* floaterp = it->first.get(); + if (floaterp) + { + floaterp->setVisible(true); + } + it->second.disconnect(); + } + mHiddenFloaters.clear(); +} BOOL LLFloaterView::allChildrenClosed() { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index b404306e94..275b508f79 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -35,6 +35,7 @@ #include "lluuid.h" //#include "llnotificationsutil.h" #include +#include class LLDragHandle; class LLResizeHandle; @@ -454,8 +455,6 @@ private: typedef std::map, LLFloater*>::iterator handle_map_iter_t; static handle_map_t sFloaterMap; - std::vector > mMinimizedHiddenChildren; - BOOL mHasBeenDraggedWhileMinimized; S32 mPreviousMinimizedBottom; S32 mPreviousMinimizedLeft; @@ -509,6 +508,10 @@ public: BOOL allChildrenClosed(); void shiftFloaters(S32 x_offset, S32 y_offset); + void hideAllFloaters(); + void showHiddenFloaters(); + + LLFloater* getFrontmost() const; LLFloater* getBackmost() const; LLFloater* getParentFloater(LLView* viewp) const; @@ -523,11 +526,15 @@ public: void setFloaterSnapView(LLHandle snap_view) {mSnapView = snap_view; } private: + void hiddenFloaterClosed(LLFloater* floater); + LLHandle mSnapView; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; S32 mSnapOffsetRight; S32 mMinimizePositionVOffset; + typedef std::vector, boost::signals2::connection> > hidden_floaters_t; + hidden_floaters_t mHiddenFloaters; }; // diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2473d41a35..665b31a427 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4992,7 +4992,11 @@ void LLViewerWindow::setUIVisibility(bool visible) if (!visible) { - gFloaterView->closeAllChildren(false); + gFloaterView->hideAllFloaters(); + } + else + { + gFloaterView->showHiddenFloaters(); } } -- cgit v1.2.3 From 23a2a77369b9f4b4fb5e606dc962e5838fb44503 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 15:39:40 -0700 Subject: added separator above navigation bar --- .../newview/skins/default/textures/navbar/separator.png | Bin 0 -> 2826 bytes indra/newview/skins/default/textures/textures.xml | 2 +- .../skins/default/xui/en/panel_navigation_bar.xml | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 indra/newview/skins/default/textures/navbar/separator.png diff --git a/indra/newview/skins/default/textures/navbar/separator.png b/indra/newview/skins/default/textures/navbar/separator.png new file mode 100644 index 0000000000..b93e5791a7 Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/separator.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 27577d42ea..4f34352516 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -769,5 +769,5 @@ with the same filename but different name - + diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index bf9eeb6d26..ab6fa36e6c 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -43,6 +43,16 @@ top="0" height="34" width="600"/> + Date: Wed, 12 Oct 2011 15:46:45 -0700 Subject: EXP-1275 WIP A UI element or Keyboard shortcut to clear the viewport added confirmation dialog before hiding UI --- indra/llui/llfloater.cpp | 1 + indra/llui/llfloater.h | 3 ++- indra/newview/llviewermenu.cpp | 30 +++++++++++++++++++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 14 +++++----- .../newview/skins/default/xui/en/notifications.xml | 14 ++++++++++ 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 4bcc7c6fe0..16fe3b8ca6 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -247,6 +247,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mHeaderHeight(p.header_height), mLegacyHeaderHeight(p.legacy_header_height), mMinimized(FALSE), + mVisibleWhenMinimized(TRUE), mForeground(FALSE), mFirstLook(TRUE), mButtonScale(1.0f), diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 275b508f79..c94aa0207e 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -212,7 +212,7 @@ public: void addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE); void addDependentFloater(LLHandle dependent_handle, BOOL reposition = TRUE); LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); } - void removeDependentFloater(LLFloater* dependent); + void removeDependentFloater(LLFloater* dependent); BOOL isMinimized() const { return mMinimized; } /// isShown() differs from getVisible() in that isShown() also considers /// isMinimized(). isShown() is true only if visible and not minimized. @@ -420,6 +420,7 @@ private: S32 mLegacyHeaderHeight;// HACK see initFloaterXML() BOOL mMinimized; + bool mVisibleWhenMinimized; BOOL mForeground; LLHandle mDependeeHandle; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0cbbfae002..478af6ab7d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3766,9 +3766,37 @@ class LLViewToggleUI : public view_listener_t { bool handleEvent(const LLSD& userdata) { - gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility()); + LLNotification::Params params("ConfirmHideUI"); + params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2)); + LLSD substitutions; +#if LL_DARWIN + substitutions["SHORTCUT"] = "Cmd+Shift+U"; +#else + substitutions["SHORTCUT"] = "Ctrl+Shift+U"; +#endif + params.substitutions = substitutions; + if (gViewerWindow->getUIVisibility()) + { + // hiding, so show notification + LLNotifications::instance().add(params); + } + else + { + LLNotifications::instance().forceResponse(params, 0); + } + return true; } + + void confirm(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) // OK + { + gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility()); + } + } }; class LLEditDuplicate : public view_listener_t diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index fdbc3d1882..c586e3a098 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -24,6 +24,13 @@ function="Floater.Toggle" parameter="toybox" /> + + + @@ -1719,13 +1726,6 @@ - - - + + + confirm + This action will hide all menu items and buttons. To get them back, click [SHORTCUT] again. + + + You do not appear to have the proper hardware requirements for [APP_NAME]. [APP_NAME] requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system. -- cgit v1.2.3 From 45a316831636043663972bdf83adbefb345549de Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 12 Oct 2011 16:08:53 -0700 Subject: EXP-1337 FIX Add Confirmation dialog to "Restore Defaults" in the Toybox Reviewed by Leslie --- indra/newview/llfloatertoybox.cpp | 17 +++++++++++++++-- indra/newview/skins/default/xui/en/notifications.xml | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index 84881655f8..b4c9894271 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -30,12 +30,13 @@ #include "llbutton.h" #include "llcommandmanager.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpanel.h" #include "lltoolbar.h" #include "lltoolbarview.h" #include "lltrans.h" - LLFloaterToybox::LLFloaterToybox(const LLSD& key) : LLFloater(key) , mBtnRestoreDefaults(NULL) @@ -113,9 +114,21 @@ void LLFloaterToybox::draw() LLFloater::draw(); } +static bool finish_restore_toybox(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + LLToolBarView::loadDefaultToolbars(); + } + return false; +} +static LLNotificationFunctorRegistration finish_restore_toybox_reg("ConfirmRestoreToybox", finish_restore_toybox); + void LLFloaterToybox::onBtnRestoreDefaults() { - LLToolBarView::loadDefaultToolbars(); + LLNotificationsUtil::add("ConfirmRestoreToybox"); } BOOL LLFloaterToybox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6b0ffd9d33..f510b3c5ba 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4622,6 +4622,20 @@ Are you sure you want to quit? yestext="Quit"/> + + +Are you sure you want to restore your default buttons and toolbars? + +You cannot undo this action. + + + Date: Wed, 12 Oct 2011 16:17:24 -0700 Subject: don't highlight toolbar buttons during drag and drop added mVisibleWhenMinimized to floaters --- indra/llui/llfloater.cpp | 22 ++++++++++++++++++---- indra/llui/llfloater.h | 4 +++- indra/llui/lltoolbar.cpp | 5 ++++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 16fe3b8ca6..1e6c8b4a71 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1407,6 +1407,17 @@ void LLFloater::removeDependentFloater(LLFloater* floaterp) floaterp->mDependeeHandle = LLHandle(); } +void LLFloater::setVisibleWhenMinimized(bool visible) +{ + mVisibleWhenMinimized = visible; + if (visible && isMinimized()) + { + // restack in minimized stack + setMinimized(FALSE); + setMinimized(TRUE); + } +} + BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index) { if( mButtonsEnabled[index] ) @@ -1783,11 +1794,14 @@ void LLFloater::draw() } if (isMinimized()) { - for (S32 i = 0; i < BUTTON_COUNT; i++) + if (mVisibleWhenMinimized) { - drawChild(mButtons[i]); + for (S32 i = 0; i < BUTTON_COUNT; i++) + { + drawChild(mButtons[i]); + } + drawChild(mDragHandle); } - drawChild(mDragHandle); } else { @@ -2442,7 +2456,7 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) { // Examine minimized children. LLFloater* floater = (LLFloater*)((LLView*)*child_it); - if(floater->isMinimized()) + if(floater->isMinimized() && floater->getVisibleWhenMinimized()) { LLRect r = floater->getRect(); if((r.mBottom < (row + floater_header_size)) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index c94aa0207e..5e3d3aefc9 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -213,7 +213,9 @@ public: void addDependentFloater(LLHandle dependent_handle, BOOL reposition = TRUE); LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); } void removeDependentFloater(LLFloater* dependent); - BOOL isMinimized() const { return mMinimized; } + BOOL isMinimized() const { return mMinimized; } + void setVisibleWhenMinimized(bool visible); + bool getVisibleWhenMinimized() const { return mVisibleWhenMinimized;} /// isShown() differs from getVisible() in that isShown() also considers /// isMinimized(). isShown() is true only if visible and not minimized. bool isShown() const; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index a1ea4ba18b..02970bc969 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -871,7 +871,10 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask) LLUICtrl::onMouseEnter(x, y, mask); // Always highlight toolbar buttons, even if they are disabled - mNeedsHighlight = TRUE; + if (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this) + { + mNeedsHighlight = TRUE; + } } void LLToolBarButton::onMouseCaptureLost() -- cgit v1.2.3 From d5d7e264ad636a42470772f5e96914327e30eca2 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 16:51:00 -0700 Subject: don't highlight toolbar buttons during drag and drop (for real) --- indra/llui/llbutton.cpp | 2 +- indra/llui/lltoolbar.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 0a7584a576..4f0c0d31bd 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -548,7 +548,7 @@ void LLButton::setHighlight(bool b) BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) { if (isInEnabledChain() - && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this)) + && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() == this)) mNeedsHighlight = TRUE; if (!childrenHandleHover(x, y, mask)) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 02970bc969..a75a1552fc 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -871,7 +871,7 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask) LLUICtrl::onMouseEnter(x, y, mask); // Always highlight toolbar buttons, even if they are disabled - if (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this) + if (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() == this) { mNeedsHighlight = TRUE; } -- cgit v1.2.3 From fbd883ab36e49fea76b16a04aad0be5fc5196d49 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Wed, 12 Oct 2011 17:18:17 -0700 Subject: updating destination guide and avatar picker urls --- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/skins/default/xui/en/floater_avatar.xml | 2 +- indra/newview/skins/default/xui/en/floater_destinations.xml | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aa2ff646a8..dd540654fb 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -619,7 +619,7 @@ Type String Value - http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/avatars.html + http://drofnas.components.pdp48.lindenlab.com/avatars.html AvatarBakedTextureUploadTimeout @@ -2717,7 +2717,7 @@ Type String Value - http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/guide.html + http://drofnas.components.pdp48.lindenlab.com/guide.html DisableCameraConstraints diff --git a/indra/newview/skins/default/xui/en/floater_avatar.xml b/indra/newview/skins/default/xui/en/floater_avatar.xml index 6e5c4ada48..3c7de6f334 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar.xml @@ -5,7 +5,7 @@ can_close="true" can_resize="true" min_height="230" - min_width="445" + min_width="450" height="230" layout="topleft" name="Avatar" diff --git a/indra/newview/skins/default/xui/en/floater_destinations.xml b/indra/newview/skins/default/xui/en/floater_destinations.xml index 2b48a9f6d6..e63dc02a57 100644 --- a/indra/newview/skins/default/xui/en/floater_destinations.xml +++ b/indra/newview/skins/default/xui/en/floater_destinations.xml @@ -7,7 +7,7 @@ user_resize="true" can_resize="true" min_height="230" - min_width="525" + min_width="350" height="230" layout="topleft" name="Destinations" @@ -22,6 +22,5 @@ width="840" follows="all" name="destination_guide_contents" - start_url="http://common-flash-secondlife-com.s3.amazonaws.com/viewer/v2.6/agni/guide.html" trusted_content="true"/> -- cgit v1.2.3 From 309ebb84a8cf93e03e2594525aa128b3002040bf Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 12 Oct 2011 17:43:47 -0700 Subject: * Floater positioning now based on position of other cascading windows currently open. --- indra/llui/llfloater.cpp | 84 ++++++++++++++-------- indra/llui/llfloater.h | 19 +++-- indra/llui/llfloaterreg.cpp | 73 +++++++++++++++++-- indra/llui/llfloaterreg.h | 2 + indra/newview/llnearbychatbar.cpp | 9 ++- indra/newview/llnearbychatbar.h | 2 +- .../skins/default/xui/en/floater_camera.xml | 4 +- .../skins/default/xui/en/floater_chat_bar.xml | 4 +- .../skins/default/xui/en/floater_moveview.xml | 4 +- 9 files changed, 152 insertions(+), 49 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 0398c0d7eb..984b710b9d 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -175,6 +175,8 @@ LLFloater::Params::Params() save_visibility("save_visibility", false), can_dock("can_dock", false), open_positioning("open_positioning", LLFloaterEnums::OPEN_POSITIONING_NONE), + specified_left("specified_left"), + specified_bottom("specified_bottom"), header_height("header_height", 0), legacy_header_height("legacy_header_height", 0), close_image("close_image"), @@ -242,6 +244,9 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mCanClose(p.can_close), mDragOnLeft(p.can_drag_on_left), mResizable(p.can_resize), + mOpenPositioning(p.open_positioning), + mSpecifiedLeft(p.specified_left), + mSpecifiedBottom(p.specified_bottom), mMinWidth(p.min_width), mMinHeight(p.min_height), mHeaderHeight(p.header_height), @@ -678,6 +683,7 @@ void LLFloater::openFloater(const LLSD& key) } else { + applyControlsAndPosition(LLFloaterReg::getLastFloaterCascading()); setMinimized(FALSE); setVisibleAndFrontmost(mAutoFocus); } @@ -840,39 +846,54 @@ LLMultiFloater* LLFloater::getHost() return (LLMultiFloater*)mHostHandle.get(); } -void LLFloater::applySavedVariables() +void LLFloater::applyControlsAndPosition(LLFloater* other) { - applyRectControl(); - applyDockState(); + if (!applyDockState()) + { + if (!applyRectControl()) + { + applyPositioning(other); + } + } } -void LLFloater::applyRectControl() +bool LLFloater::applyRectControl() { + bool saved_rect = false; + // If we have a saved rect, use it if (mRectControl.size() > 1) { const LLRect& rect = getControlGroup()->getRect(mRectControl); - if (rect.notEmpty()) + saved_rect = rect.notEmpty(); + if (saved_rect) { setOrigin(rect.mLeft, rect.mBottom); + if (mResizable) { reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight())); } } } + + return saved_rect; } -void LLFloater::applyDockState() +bool LLFloater::applyDockState() { + bool docked = false; + if (mDocStateControl.size() > 1) { - bool dockState = getControlGroup()->getBOOL(mDocStateControl); - setDocked(dockState); + docked = getControlGroup()->getBOOL(mDocStateControl); + setDocked(docked); } + + return docked; } -void LLFloater::applyPositioning() +void LLFloater::applyPositioning(LLFloater* other) { // Otherwise position according to the positioning code switch (mOpenPositioning) @@ -884,28 +905,33 @@ void LLFloater::applyPositioning() case LLFloaterEnums::OPEN_POSITIONING_SPECIFIED: { // Translate relative to snap rect - LLRect r = getRect(); - r.mBottom = getSnapRect().getHeight() - r.getHeight() - r.mBottom; - setOrigin(r.mLeft, r.mBottom); - translateIntoRect(getSnapRect(), FALSE); + setOrigin(mSpecifiedLeft, mSpecifiedBottom); + const LLRect& snap_rect = gFloaterView->getSnapRect(); + translate(snap_rect.mLeft, snap_rect.mBottom); + translateIntoRect(snap_rect, FALSE); } break; case LLFloaterEnums::OPEN_POSITIONING_CASCADING: + if (other != NULL) { - static const U32 CASCADING_FLOATER_HOFFSET = 25; - static const U32 CASCADING_FLOATER_VOFFSET = 25; - static const S32 CASCADING_FLOATER_LIMIT = 15; - static S32 cascading_floater_count = 1; - const S32 top = CASCADING_FLOATER_VOFFSET * cascading_floater_count; - const S32 left = CASCADING_FLOATER_HOFFSET * cascading_floater_count; - setOrigin(left, top); - translateIntoRect(getSnapRect(), FALSE); + stackWith(*other); + } + else + { + static const U32 CASCADING_FLOATER_HOFFSET = 0; + static const U32 CASCADING_FLOATER_VOFFSET = 0; + + const LLRect& snap_rect = gFloaterView->getSnapRect(); - if (++cascading_floater_count > CASCADING_FLOATER_LIMIT) - { - cascading_floater_count = 1; - } + const S32 horizontal_offset = CASCADING_FLOATER_HOFFSET; + const S32 vertical_offset = snap_rect.getHeight() - CASCADING_FLOATER_VOFFSET; + + S32 rect_height = getRect().getHeight(); + setOrigin(horizontal_offset, vertical_offset - rect_height); + + translate(snap_rect.mLeft, snap_rect.mBottom); + translateIntoRect(snap_rect, FALSE); } break; @@ -2891,9 +2917,11 @@ void LLFloater::initFromParams(const LLFloater::Params& p) mHeaderHeight = p.header_height; mLegacyHeaderHeight = p.legacy_header_height; mSingleInstance = p.single_instance; + mOpenPositioning = p.open_positioning; + mSpecifiedLeft = p.specified_left; + mSpecifiedBottom = p.specified_bottom; - /* if (p.save_rect && mRectControl.empty()) { mRectControl = "t"; // flag to build mRectControl name once mInstanceName is set @@ -2901,8 +2929,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) if (p.save_visibility) { mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set - }*/ - + } if(p.save_dock_state) { mDocStateControl = "t"; // flag to build mDocStateControl name once mInstanceName is set @@ -3053,7 +3080,6 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str llerrs << "Failed to construct floater " << getName() << llendl; } - applyPositioning(); applyRectControl(); // If we have a saved rect control, apply it gFloaterView->adjustToFitScreen(this, FALSE); // Floaters loaded from XML should all fit on screen diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index b404306e94..b094c76168 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -130,6 +130,9 @@ public: can_dock; Optional open_positioning; + Optional specified_left; + Optional specified_bottom; + Optional header_height, legacy_header_height; // HACK see initFromXML() @@ -291,8 +294,6 @@ public: virtual void setTornOff(bool torn_off) { mTornOff = torn_off; } - void stackWith(LLFloater& other); - // Return a closeable floater, if any, given the current focus. static LLFloater* getClosableFloaterFromFocus(); @@ -317,12 +318,16 @@ public: void updateTransparency(ETypeTransparency transparency_type); void enableResizeCtrls(bool enable, bool width = true, bool height = true); + + bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mOpenPositioning); } protected: - virtual void applySavedVariables(); + void applyControlsAndPosition(LLFloater* other); + + void stackWith(LLFloater& other); - virtual void applyRectControl(); - void applyDockState(); - void applyPositioning(); + virtual bool applyRectControl(); + bool applyDockState(); + void applyPositioning(LLFloater* other); void storeRectControl(); void storeVisibilityControl(); void storeDockStateControl(); @@ -412,6 +417,8 @@ private: BOOL mResizable; LLFloaterEnums::EOpenPositioning mOpenPositioning; + S32 mSpecifiedLeft; + S32 mSpecifiedBottom; S32 mMinWidth; S32 mMinHeight; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 058223abbd..a148f5a32e 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -59,19 +59,57 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con //static LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name) { - LLRect rect; const std::string& groupname = sGroupMap[name]; if (!groupname.empty()) { instance_list_t& list = sInstanceMap[groupname]; if (!list.empty()) { - return list.back(); + for (instance_list_t::reverse_iterator iter = list.rbegin(); iter != list.rend(); ++iter) + { + LLFloater* inst = *iter; + + if (inst->getVisible() && !inst->isMinimized()) + { + return inst; + } + } } } return NULL; } +LLFloater* LLFloaterReg::getLastFloaterCascading() +{ + LLRect candidate_rect; + candidate_rect.mTop = 100000; + LLFloater* candidate_floater = NULL; + + std::map::const_iterator it = sGroupMap.begin(), it_end = sGroupMap.end(); + for( ; it != it_end; ++it) + { + const std::string& group_name = it->second; + + instance_list_t& instances = sInstanceMap[group_name]; + + for (instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); ++iter) + { + LLFloater* inst = *iter; + + if (inst->getVisible() && inst->isPositioning(LLFloaterEnums::OPEN_POSITIONING_CASCADING)) + { + if (candidate_rect.mTop > inst->getRect().mTop) + { + candidate_floater = inst; + candidate_rect = inst->getRect(); + } + } + } + } + + return candidate_floater; +} + //static LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key) { @@ -127,9 +165,10 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res->mKey = key; } res->setInstanceName(name); - res->applySavedVariables(); // Can't apply rect and dock state until setting instance name - // apply list.size() and possibly stackWith(getLastFloaterInGroup(groupname)) + LLFloater *last_floater = (list.empty() ? NULL : list.back()); + res->applyControlsAndPosition(last_floater); + gFloaterView->adjustToFitScreen(res, false); list.push_back(res); @@ -533,3 +572,29 @@ bool LLFloaterReg::floaterInstanceMinimized(const LLSD& sdname) LLFloater* instance = findInstance(name, key); return LLFloater::isShown(instance); } + +// static +U32 LLFloaterReg::getVisibleFloaterInstanceCount() +{ + U32 count = 0; + + std::map::const_iterator it = sGroupMap.begin(), it_end = sGroupMap.end(); + for( ; it != it_end; ++it) + { + const std::string& group_name = it->second; + + instance_list_t& instances = sInstanceMap[group_name]; + + for (instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); ++iter) + { + LLFloater* inst = *iter; + + if (inst->getVisible() && !inst->isMinimized()) + { + count++; + } + } + } + + return count; +} diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 07ae45cc4c..817fe2e8c6 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -87,6 +87,7 @@ public: // Helpers static LLFloater* getLastFloaterInGroup(const std::string& name); + static LLFloater* getLastFloaterCascading(); // Find / get (create) / remove / destroy static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD()); @@ -153,6 +154,7 @@ public: static void blockShowFloaters(bool value) { sBlockShowFloaters = value;} + static U32 getVisibleFloaterInstanceCount(); }; #endif diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index cd84275ef0..3e4228cfb6 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -109,15 +109,18 @@ BOOL LLNearbyChatBar::postBuild() return TRUE; } -void LLNearbyChatBar::applyRectControl() +bool LLNearbyChatBar::applyRectControl() { - LLFloater::applyRectControl(); - if (getRect().getHeight() > getMinHeight()) + bool rect_controlled = LLFloater::applyRectControl(); + + if (getRect().getHeight() > getMinHeight()) { getChildView("nearby_chat")->setVisible(true); mExpandedHeight = getRect().getHeight(); enableResizeCtrls(true); } + + return rect_controlled; } void LLNearbyChatBar::onChatFontChange(LLFontGL* fontp) diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 5a7edac1bb..bc00c1b9fc 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -71,7 +71,7 @@ protected: void onChatBoxCommit(); void onChatFontChange(LLFontGL* fontp); - /* virtual */ void applyRectControl(); + /* virtual */ bool applyRectControl(); void onToggleNearbyChatPanel(); diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 7f3abbb481..20d0fa1c91 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -1,14 +1,14 @@ Date: Wed, 12 Oct 2011 17:45:21 -0700 Subject: * Added mModified flag and isModified() query to check it. (currently it is not connect to actual data) --- indra/llui/lltoolbar.cpp | 1 + indra/llui/lltoolbar.h | 4 +++- indra/newview/lltoolbarview.cpp | 11 +++++++++++ indra/newview/lltoolbarview.h | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index a1ea4ba18b..1320f03a25 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -99,6 +99,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mSideType(p.side), mWrap(p.wrap), mNeedsLayout(false), + mModified(false), mButtonPanel(NULL), mCenteringStack(NULL), mPadLeft(p.pad_left), diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 709399c59f..2c66f29c16 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -178,7 +178,8 @@ public: LLToolBarButton* createButton(const LLCommandId& id); - bool hasButtons() { return !mButtons.empty(); } + bool hasButtons() const { return !mButtons.empty(); } + bool isModified() const { return mModified; } protected: friend class LLUICtrlFactory; @@ -225,6 +226,7 @@ private: bool mWrap; bool mNeedsLayout; + bool mModified; S32 mPadLeft, mPadRight, mPadTop, diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 133835aafc..bac154f435 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -471,3 +471,14 @@ void LLToolBarView::setToolBarsVisible(bool visible) mToolbarLeft->getParent()->setVisible(visible); mToolbarRight->getParent()->setVisible(visible); } + +bool LLToolBarView::isModified() const +{ + bool modified = false; + + modified |= mToolbarBottom->isModified(); + modified |= mToolbarLeft->isModified(); + modified |= mToolbarRight->isModified(); + + return modified; +} diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 01ff137c15..8b3af43875 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -81,6 +81,8 @@ public: static BOOL handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); static void stopDragTool(); void onEndDrag(); + + bool isModified() const; protected: friend class LLUICtrlFactory; -- cgit v1.2.3