ContextMenu Support!
LLContextMenu functionality pulled out of LLPieMenu, PieMenu is now derived from LLContextMenu - The more attribute boolean of pie_menu element determines whether or not to have an actual submenu if it's not a pie, defaults to false which means actual submenu.. -- in the future we may want to have more more="true" depending on feedback - Pie menu labels now dynamically get " >" appended to them (avoids stupid looking context menus) - Positioning logic combined in part, mostly conditional still, in the future we could probably combine it more. - handleHoverOver function combines common functionality between context and pies given an item and hover mouse coords. LiruUseContextMenus debug setting determines which to use, default is pie, of course - Context(/Pie) Menus are rebuilt when the setting changes value -- this is safe at any point because all startup states have been accounted for - "Use context menus instead of pie menus" added to System->General preferences (it's close to the bottom)
This commit is contained in:
@@ -446,7 +446,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parent
|
||||
//-----------------------------------------------------------------------------
|
||||
// buildMenu()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPieMenu *LLUICtrlFactory::buildPieMenu(const std::string &filename, LLView* parentp)
|
||||
LLContextMenu* LLUICtrlFactory::buildContextMenu(const std::string& filename, LLView* parentp)
|
||||
{
|
||||
LLXMLNodePtr root;
|
||||
|
||||
@@ -465,9 +465,10 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const std::string &filename, LLView* pa
|
||||
std::string name("menu");
|
||||
root->getAttributeString("name", name);
|
||||
|
||||
LLPieMenu *menu = new LLPieMenu(name);
|
||||
static LLUICachedControl<bool> context("LiruUseContextMenus", false);
|
||||
LLContextMenu* menu = context ? new LLContextMenu(name) : new LLPieMenu(name);
|
||||
parentp->addChild(menu);
|
||||
menu->initXML(root, parentp, this);
|
||||
menu->initXML(root, parentp, this, context);
|
||||
|
||||
if (LLUI::sShowXUINames)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user