From 20ad5181babd7662bddf95b94bb25cc522d6186d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 23 Feb 2011 16:44:04 -0800 Subject: SOCIAL-551 WIP Add buttons to open people and profile windows bottom tray button now toggles profile window --- indra/newview/llviewermenu.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7cc04e0338..dd6b034dc8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5788,6 +5788,44 @@ class LLShowAgentProfile : public view_listener_t } }; +class LLToggleAgentProfile : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLUUID agent_id; + if (userdata.asString() == "agent") + { + agent_id = gAgent.getID(); + } + else if (userdata.asString() == "hit object") + { + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (objectp) + { + agent_id = objectp->getID(); + } + } + else + { + agent_id = userdata.asUUID(); + } + + LLVOAvatar* avatar = find_avatar_from_object(agent_id); + if (avatar) + { + if (!LLAvatarActions::profileVisible(avatar->getID())) + { + LLAvatarActions::showProfile(avatar->getID()); + } + else + { + LLAvatarActions::hideProfile(avatar->getID()); + } + } + return true; + } +}; + class LLLandEdit : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8184,6 +8222,7 @@ void initialize_menus() view_listener_t::addMenu(new LLShowHelp(), "ShowHelp"); view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL"); view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); + view_listener_t::addMenu(new LLToggleAgentProfile(), "ToggleAgentProfile"); view_listener_t::addMenu(new LLToggleControl(), "ToggleControl"); view_listener_t::addMenu(new LLCheckControl(), "CheckControl"); view_listener_t::addMenu(new LLGoToObject(), "GoToObject"); -- cgit v1.2.3 From 874da4cde8914de81992505ade8bc7f106a6019a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 24 Feb 2011 18:37:06 -0800 Subject: SOCIAL-551 WIP add buttons to open people and profile windows ShowSideTrayPanel action can now toggle undocked panels OpenSidePanelsInFloaters works now Clossing a sidepanel floater will not return contents to side tray close button enabled in minimal skin for side panel floaters --- indra/newview/llviewermenu.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index dd6b034dc8..02ef1e4e50 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5651,15 +5651,18 @@ class LLShowSidetrayPanel : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string panel_name = userdata.asString(); - // Toggle the panel - if (!LLSideTray::getInstance()->isPanelActive(panel_name)) - { - // LLFloaterInventory::showAgentInventory(); - LLSideTray::getInstance()->showPanel(panel_name, LLSD()); - } - else + + LLPanel* panel = LLSideTray::getInstance()->getPanel(panel_name); + if (panel) { - LLSideTray::getInstance()->collapseSideBar(); + if (panel->isInVisibleChain()) + { + LLSideTray::getInstance()->hidePanel(panel_name); + } + else + { + LLSideTray::getInstance()->showPanel(panel_name); + } } return true; } -- cgit v1.2.3 From 31d0bf5ba5dd5e1df6c42dd19ce63ef3978a2f4c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 25 Feb 2011 13:48:20 -0800 Subject: updates destination guide and avatar picker urls added close button to destination guide and avatar picker --- indra/newview/llviewermenu.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 02ef1e4e50..82df525a4f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -843,9 +843,9 @@ class LLAdvancedCheckFeature : public view_listener_t } }; -void LLDestinationAndAvatarShow(const LLSD& value) +void toggle_destination_and_avatar_picker(const LLSD& show) { - S32 panel_idx = value.isDefined() ? value.asInteger() : -1; + S32 panel_idx = show.isDefined() ? show.asInteger() : -1; LLView* container = gViewerWindow->getRootView()->getChildView("avatar_picker_and_destination_guide_container"); LLMediaCtrl* destinations = container->findChild("destination_guide_contents"); LLMediaCtrl* avatar_picker = container->findChild("avatar_picker_contents"); @@ -870,6 +870,8 @@ void LLDestinationAndAvatarShow(const LLSD& value) avatar_picker->setVisible(false); break; } + + gViewerWindow->getRootView()->getChildView("bottom_tray")->getChild("avatar_and_destination_btns")->setValue(show); }; @@ -8246,5 +8248,5 @@ void initialize_menus() view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); - commit.add("DestinationAndAvatar.show", boost::bind(&LLDestinationAndAvatarShow, _2)); + commit.add("DestinationAndAvatar.show", boost::bind(&toggle_destination_and_avatar_picker, _2)); } -- cgit v1.2.3 From 903b3ab35d67eec1b780b0e9f7407f7c47544ea9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 28 Feb 2011 17:38:35 -0800 Subject: SOCIAL-601 FIX avatar picker hint --- indra/newview/llviewermenu.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 82df525a4f..4f7a34e625 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -862,7 +862,6 @@ void toggle_destination_and_avatar_picker(const LLSD& show) container->setVisible(true); destinations->setVisible(false); avatar_picker->setVisible(true); - LLFirstUse::notUsingAvatarPicker(false); break; default: container->setVisible(false); -- cgit v1.2.3 From 25ad57c4b6db3793a0bb6fc1901ea6b0e969c17f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 4 Mar 2011 00:40:38 -0800 Subject: SOCIAL-603 FIX Move how to button to bottom bar moves scrollbar up from bottom of screen to leave room for resize thumb --- indra/newview/llviewermenu.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4f7a34e625..38877b7836 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5647,6 +5647,25 @@ class LLShowHelp : public view_listener_t } }; +class LLToggleHelp : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloater* help_browser = (LLFloaterReg::findInstance("help_browser")); + if (help_browser && help_browser->isInVisibleChain()) + { + help_browser->closeFloater(); + } + else + { + std::string help_topic = userdata.asString(); + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + vhelp->showTopic(help_topic); + } + return true; + } +}; + class LLShowSidetrayPanel : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8224,6 +8243,7 @@ void initialize_menus() commit.add("ReportAbuse", boost::bind(&handle_report_abuse)); commit.add("BuyCurrency", boost::bind(&handle_buy_currency)); view_listener_t::addMenu(new LLShowHelp(), "ShowHelp"); + view_listener_t::addMenu(new LLToggleHelp(), "ToggleHelp"); view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL"); view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); view_listener_t::addMenu(new LLToggleAgentProfile(), "ToggleAgentProfile"); -- cgit v1.2.3 From 4986896079c90c2fff1f72ccf78a4bb6ee9bbcb8 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 14 Mar 2011 17:21:45 -0700 Subject: SOCIAL-605 Bottom bar buttons scale differently at lower resolutions --- indra/newview/llviewermenu.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 030808db92..add24e5216 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -849,6 +849,8 @@ void toggle_destination_and_avatar_picker(const LLSD& show) LLView* container = gViewerWindow->getRootView()->getChildView("avatar_picker_and_destination_guide_container"); LLMediaCtrl* destinations = container->findChild("destination_guide_contents"); LLMediaCtrl* avatar_picker = container->findChild("avatar_picker_contents"); + LLButton* avatar_btn = gViewerWindow->getRootView()->getChildView("bottom_tray")->getChild("avatar_btn"); + LLButton* destination_btn = gViewerWindow->getRootView()->getChildView("bottom_tray")->getChild("destination_btn"); switch(panel_idx) { @@ -857,20 +859,24 @@ void toggle_destination_and_avatar_picker(const LLSD& show) destinations->setVisible(true); avatar_picker->setVisible(false); LLFirstUse::notUsingDestinationGuide(false); + avatar_btn->setToggleState(false); + destination_btn->setToggleState(true); break; case 1: container->setVisible(true); destinations->setVisible(false); avatar_picker->setVisible(true); + avatar_btn->setToggleState(true); + destination_btn->setToggleState(false); break; default: container->setVisible(false); destinations->setVisible(false); avatar_picker->setVisible(false); + avatar_btn->setToggleState(false); + destination_btn->setToggleState(false); break; } - - gViewerWindow->getRootView()->getChildView("bottom_tray")->getChild("avatar_and_destination_btns")->setValue(show); }; @@ -8163,5 +8169,6 @@ void initialize_menus() view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); - commit.add("DestinationAndAvatar.show", boost::bind(&toggle_destination_and_avatar_picker, _2)); + commit.add("Destination.show", boost::bind(&toggle_destination_and_avatar_picker, 0)); + commit.add("Avatar.show", boost::bind(&toggle_destination_and_avatar_picker, 1)); } -- cgit v1.2.3