From c20bd2dfee1068d5a23eef9a10d21c2035c0b324 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 16 Aug 2010 15:00:51 -0700 Subject: cleaned up LLUICtrlFactory... removed redundant functionality moved buildPanel to LLPanel --- indra/newview/llpaneloutfitedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index cfd31b6829..81bd6b5414 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -491,7 +491,7 @@ BOOL LLPanelOutfitEdit::postBuild() setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2)); - mCOFWearables = getChild("cof_wearables_list"); + mCOFWearables = findChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this)); mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this); -- cgit v1.2.3 From c12c60df4a28b3cb91870ae0666eb6b3422ff96b Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 15 Oct 2010 00:10:55 +0300 Subject: STORM-263 FIXED popup menu of Cog button in lower-left of sidebar panel closing on second click - Changed type of gear menu buttons from LLButton to LLMenuButton in all sidebar panels where gear menu button is used. - Added setMenuPosition(), setMenu() and updateMenuOrigin() to the LLMenuButton. - Moved actions common for displaying a context menu to LLMenuButton::toggleMenu(). - In all sidebar panels where LLButton was replaced with LLMenuButton the following steps were taken: 1. setting gearMenu and its position relative to the menuButton with LLMenuButton::setMenu() 2. setting mouse down callback for the menuButton if needed. 3. calculating the menu origin point with LLMenuButton::updateMenuOrigin() in mouse down callback --- indra/newview/llpaneloutfitedit.cpp | 48 +++++++++++-------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 494db01f77..5638374178 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -56,6 +56,7 @@ #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" #include "llloadingindicator.h" +#include "llmenubutton.h" #include "llpaneloutfitsinventory.h" #include "lluiconstants.h" #include "llsaveoutfitcombobtn.h" @@ -403,7 +404,9 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mAddWearablesPanel(NULL), mFolderViewFilterCmbBox(NULL), mListViewFilterCmbBox(NULL), - mPlusBtn(NULL) + mPlusBtn(NULL), + mWearablesGearMenuBtn(NULL), + mGearMenuBtn(NULL) { mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); @@ -478,13 +481,14 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); - childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); - childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2)); + mWearablesGearMenuBtn = getChild("wearables_gear_menu_btn"); + mGearMenuBtn = getChild("gear_menu_btn"); + mCOFWearables = findChild("cof_wearables_list"); mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this)); @@ -557,6 +561,13 @@ BOOL LLPanelOutfitEdit::postBuild() mWearableItemsList->setComparator(mWearableListViewItemsComparator); + // Creating "Add Wearables" panel gear menu after initialization of mWearableItemsList and mInventoryItemsPanel. + mAddWearablesGearMenu = LLAddWearablesGearMenu::create(mWearableItemsList, mInventoryItemsPanel); + mWearablesGearMenuBtn->setMenu(mAddWearablesGearMenu); + + mGearMenu = LLPanelOutfitEditGearMenu::create(); + mGearMenuBtn->setMenu(mGearMenu); + mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); return TRUE; } @@ -1256,37 +1267,6 @@ void LLPanelOutfitEdit::resetAccordionState() } } -void LLPanelOutfitEdit::onGearButtonClick(LLUICtrl* clicked_button) -{ - LLMenuGL* menu = NULL; - - if (mAddWearablesPanel->getVisible()) - { - if (!mAddWearablesGearMenu) - { - mAddWearablesGearMenu = LLAddWearablesGearMenu::create(mWearableItemsList, mInventoryItemsPanel); - } - - menu = mAddWearablesGearMenu; - } - else - { - if (!mGearMenu) - { - mGearMenu = LLPanelOutfitEditGearMenu::create(); - } - - menu = mGearMenu; - } - - if (!menu) return; - - menu->arrangeAndClear(); // update menu height - S32 menu_y = menu->getRect().getHeight() + clicked_button->getRect().getHeight(); - menu->buildDrawLabels(); - LLMenuGL::showPopup(clicked_button, menu, 0, menu_y); -} - void LLPanelOutfitEdit::onAddMoreButtonClicked() { toggleAddWearablesPanel(); -- cgit v1.2.3 From 54da19fdcfa3edadbc58a1f55a3503082e66f16e Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 22 Oct 2010 02:08:26 +0300 Subject: STORM-426 FIXED Menu button no longer looked pressed while its menu is displayed by another control. - LLMenuGL in menu button replaced by LLToggleableMenu that handles visibility change upon clicks inside specific button rect. - Added visibility change signal to LLToggleableMenu to update menu button pressed state. - Added using menu handle in LLMenuButton. --- indra/newview/llpaneloutfitedit.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 5638374178..6394239889 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -62,6 +62,7 @@ #include "llsaveoutfitcombobtn.h" #include "llscrolllistctrl.h" #include "lltextbox.h" +#include "lltoggleablemenu.h" #include "lltrans.h" #include "lluictrlfactory.h" #include "llsdutil.h" @@ -152,13 +153,13 @@ std::string LLShopURLDispatcher::resolveURL(LLAssetType::EType asset_type, ESex class LLPanelOutfitEditGearMenu { public: - static LLMenuGL* create() + static LLToggleableMenu* create() { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("Wearable.Create", boost::bind(onCreate, _2)); - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile( + LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); llassert(menu); if (menu) @@ -219,7 +220,7 @@ private: class LLAddWearablesGearMenu : public LLInitClass { public: - static LLMenuGL* create(LLWearableItemsList* flat_list, LLInventoryPanel* inventory_panel) + static LLToggleableMenu* create(LLWearableItemsList* flat_list, LLInventoryPanel* inventory_panel) { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -234,7 +235,7 @@ public: enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2)); enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile( + LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_add_wearable_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); -- cgit v1.2.3 From ba0d4ccaf49753bd8c3eca127d41fa7072782473 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 25 Oct 2010 21:38:22 +0300 Subject: STORM-341 FIXED Crash on exiting viewer while Outfit Editor is opened in detached Appearance SP. Reason: An inventory observer (LLFilteredWearableListManager) tried to use a deleted collect functor (LLFilterItem::collector in LLPanelOutfitEdit::mListViewItemTypes). Fix: De-register (and delete) the observer when the collector gets deleted. --- indra/newview/llpaneloutfitedit.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llpaneloutfitedit.cpp') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 5638374178..63076364bc 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -404,6 +404,7 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mAddWearablesPanel(NULL), mFolderViewFilterCmbBox(NULL), mListViewFilterCmbBox(NULL), + mWearableListManager(NULL), mPlusBtn(NULL), mWearablesGearMenuBtn(NULL), mGearMenuBtn(NULL) @@ -431,6 +432,7 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() LLPanelOutfitEdit::~LLPanelOutfitEdit() { + delete mWearableListManager; delete mSavedFolderState; delete mCOFDragAndDropObserver; -- cgit v1.2.3