Do the scroll list menu thing more cleanly.
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
static LLRegisterWidget<LLScrollListCtrl> r("scroll_list");
|
static LLRegisterWidget<LLScrollListCtrl> r("scroll_list");
|
||||||
|
|
||||||
LLMenuGL* sScrollListMenus[1] = {}; // List menus that recur, such as general avatars or groups menus
|
std::vector<LLMenuGL*> LLScrollListCtrl::sMenus = {}; // List menus that recur, such as general avatars or groups menus
|
||||||
|
|
||||||
// local structures & classes.
|
// local structures & classes.
|
||||||
struct SortScrollListItem
|
struct SortScrollListItem
|
||||||
@@ -2576,7 +2576,7 @@ void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node)
|
|||||||
// 0 is menu_avs_list.xml, 1 will be for groups, 2 could be for lists of objects
|
// 0 is menu_avs_list.xml, 1 will be for groups, 2 could be for lists of objects
|
||||||
S32 menu_num;
|
S32 menu_num;
|
||||||
node->getAttributeS32("menu_num", menu_num);
|
node->getAttributeS32("menu_num", menu_num);
|
||||||
mPopupMenu = sScrollListMenus[menu_num];
|
setContextMenu(menu_num);
|
||||||
}
|
}
|
||||||
else if (node->hasAttribute("menu_file"))
|
else if (node->hasAttribute("menu_file"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ public:
|
|||||||
|
|
||||||
// support right-click context menus for avatar/group lists
|
// support right-click context menus for avatar/group lists
|
||||||
void setContextMenu(LLMenuGL* menu) { mPopupMenu = menu; }
|
void setContextMenu(LLMenuGL* menu) { mPopupMenu = menu; }
|
||||||
|
void setContextMenu(S32 index) { mPopupMenu = sMenus[index]; }
|
||||||
|
static void addCommonMenu(LLMenuGL* menu) { sMenus.push_back(menu); }
|
||||||
|
|
||||||
// Overridden from LLView
|
// Overridden from LLView
|
||||||
/*virtual*/ void draw();
|
/*virtual*/ void draw();
|
||||||
@@ -456,6 +458,8 @@ private:
|
|||||||
S32 mHighlightedItem;
|
S32 mHighlightedItem;
|
||||||
class LLViewBorder* mBorder;
|
class LLViewBorder* mBorder;
|
||||||
LLMenuGL *mPopupMenu;
|
LLMenuGL *mPopupMenu;
|
||||||
|
|
||||||
|
static std::vector<LLMenuGL*> sMenus; // List menus that recur, such as general avatars or groups menus
|
||||||
|
|
||||||
LLView *mCommentTextView;
|
LLView *mCommentTextView;
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ extern BOOL gDebugTextEditorTips;
|
|||||||
extern BOOL gShowOverlayTitle;
|
extern BOOL gShowOverlayTitle;
|
||||||
extern BOOL gOcclusionCull;
|
extern BOOL gOcclusionCull;
|
||||||
extern AIHTTPView* gHttpView;
|
extern AIHTTPView* gHttpView;
|
||||||
extern LLMenuGL* sScrollListMenus[1];
|
|
||||||
//
|
//
|
||||||
// Globals
|
// Globals
|
||||||
//
|
//
|
||||||
@@ -730,8 +729,8 @@ void init_menus()
|
|||||||
gMenuHolder->addChild(gLoginMenuBarView);
|
gMenuHolder->addChild(gLoginMenuBarView);
|
||||||
|
|
||||||
// Singu Note: Initialize common ScrollListMenus here
|
// Singu Note: Initialize common ScrollListMenus here
|
||||||
sScrollListMenus[0] = LLUICtrlFactory::getInstance()->buildMenu("menu_avs_list.xml", gMenuHolder);
|
LLScrollListCtrl::addCommonMenu(LLUICtrlFactory::getInstance()->buildMenu("menu_avs_list.xml", gMenuHolder)); // 0
|
||||||
//sScrollListMenus[1] = LLUICtrlFactory::getInstance()->buildMenu("menu_groups_list.xml"); // Singu TODO
|
//LLScrollListCtrl::addCommonMenu(LLUICtrlFactory::getInstance()->buildMenu("menu_groups_list.xml")); // 1 // Singu TODO
|
||||||
|
|
||||||
LLView* ins = gMenuBarView->getChildView("insert_world", true, false);
|
LLView* ins = gMenuBarView->getChildView("insert_world", true, false);
|
||||||
ins->setVisible(false);
|
ins->setVisible(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user