From 5796f8e8bfb1809755327d1c51ac66c6509370a5 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 27 May 2011 20:25:26 -0700 Subject: Fixed #875 by removing menu border introduced in 84ba6c13 (cherry picked from commit bcfe397d0f3ab2bd8df3f8055f089824dd082bf4) --- linden/indra/llui/lllineeditor.cpp | 5 +- linden/indra/llui/llmenugl.cpp | 44 ++++----------- linden/indra/llui/llmenugl.h | 5 +- linden/indra/llui/lltexteditor.cpp | 4 +- linden/indra/newview/llviewermenu.cpp | 6 +- linden/indra/newview/skins/default/colors_base.xml | 2 +- .../newview/skins/default/xui/en-us/menu_login.xml | 22 +++++--- .../skins/default/xui/en-us/menu_viewer.xml | 65 ++++++++++++++-------- 8 files changed, 74 insertions(+), 79 deletions(-) diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index c4f9525..5f16853 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -223,18 +223,15 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect, } mImage = sImage; - LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_rightclick_text.xml",this); if (!menu) { - menu = new LLMenuGL(LLStringUtil::null); + menu = new LLMenuGL(LLStringUtil::null); } defineMenuCallbacks(menu); mPopupMenuHandle = menu->getHandle(); - menu->setBorderColor(gColors.getColor("MenuItemDisabledColor")); menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); - } diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index d5e1186..2d4a2f1 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp @@ -3099,8 +3099,7 @@ void LLMenuGL::draw( void ) if( mBgVisible ) { - gl_rect_2d( -1, getRect().getHeight()+2, getRect().getWidth()+2, -2, mBorderColor,FALSE); - gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0, mBackgroundColor ); + gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0, mBackgroundColor ); } LLView::draw(); } @@ -3157,37 +3156,18 @@ LLMenuGL* LLMenuGL::getChildMenuByName(const std::string& name, BOOL recurse) co } -void LLMenuGL::setBackgroundColor( const LLColor4& color ) { - - mBackgroundColor = color; - item_list_t::iterator item_iter; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) - { - if((*item_iter)->getType()=="menu") - { - LLMenuItemBranchGL *menuBranchItem = (LLMenuItemBranchGL*)(*item_iter); - menuBranchItem->getBranch()->setBackgroundColor(color); - } - } - - -} - - -void LLMenuGL::setBorderColor( const LLColor4& color ) { - - mBorderColor = color; - item_list_t::iterator item_iter; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) +void LLMenuGL::setBackgroundColor( const LLColor4& color ) +{ + mBackgroundColor = color; + item_list_t::iterator item_iter; + for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { - if((*item_iter)->getType()=="menu") - { - LLMenuItemBranchGL *menuBranchItem = (LLMenuItemBranchGL*)(*item_iter); - menuBranchItem->getBranch()->setBorderColor(color); - } - } - - + if((*item_iter)->getType()=="menu") + { + LLMenuItemBranchGL *menuBranchItem = (LLMenuItemBranchGL*)(*item_iter); + menuBranchItem->getBranch()->setBackgroundColor(color); + } + } } diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h index 9a9d1b0..3b57a32 100644 --- a/linden/indra/llui/llmenugl.h +++ b/linden/indra/llui/llmenugl.h @@ -514,10 +514,8 @@ public: // background colors static void setDefaultBackgroundColor( const LLColor4& color ) { sDefaultBackgroundColor = color; } - void setBackgroundColor( const LLColor4& color ); - void setBorderColor( const LLColor4& color ); + void setBackgroundColor( const LLColor4& color ); const LLColor4& getBackgroundColor() const { return mBackgroundColor; } - const LLColor4& getBorderColor() const { return mBorderColor; } void setBackgroundVisible( BOOL b ) { mBgVisible = b; } void setCanTearOff(BOOL tear_off, LLHandle parent_floater_handle = LLHandle()); @@ -631,7 +629,6 @@ private: static BOOL sKeyboardMode; LLColor4 mBackgroundColor; - LLColor4 mBorderColor; BOOL mBgVisible; LLMenuItemGL* mParentMenuItem; LLUIString mLabel; diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 79966c2..de05872 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -389,14 +389,12 @@ LLTextEditor::LLTextEditor( LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_rightclick_text.xml",this); if (!menu) { - menu = new LLMenuGL(LLStringUtil::null); + menu = new LLMenuGL(LLStringUtil::null); } defineMenuCallbacks(menu); mPopupMenuHandle = menu->getHandle(); - menu->setBorderColor(gColors.getColor("MenuItemDisabledColor")); menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); - } LLTextEditor::~LLTextEditor() diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index c8adf7b..1fe2dde 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -564,7 +564,7 @@ void pre_init_menus() // static information LLColor4 color; color = gColors.getColor( "MenuDefaultBgColor" ); - LLMenuGL::setDefaultBackgroundColor( color ); + LLMenuGL::setDefaultBackgroundColor(color); color = gColors.getColor( "MenuItemEnabledColor" ); LLMenuItemGL::setEnabledColor( color ); color = gColors.getColor( "MenuItemDisabledColor" ); @@ -662,7 +662,9 @@ void init_menus() } gMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_viewer.xml", gMenuHolder); gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); - gMenuBarView->setBackgroundColor( color ); + + // main menu colors + gMenuBarView->setBackgroundColor(color); // gMenuBarView->setItemVisible("Tools", FALSE); gMenuBarView->arrange(); diff --git a/linden/indra/newview/skins/default/colors_base.xml b/linden/indra/newview/skins/default/colors_base.xml index b90f8aa..63ca3e0 100644 --- a/linden/indra/newview/skins/default/colors_base.xml +++ b/linden/indra/newview/skins/default/colors_base.xml @@ -85,7 +85,7 @@ - + diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_login.xml b/linden/indra/newview/skins/default/xui/en-us/menu_login.xml index c65a737..d17fad5 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_login.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_login.xml @@ -1,18 +1,21 @@ - - - - - - + + + + + + + opaque="true" tear_off="false" + drop_shadow="true" mouse_opaque="false"> @@ -32,7 +35,8 @@ - + diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 9bd37a0..0ebbf74 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -7,6 +7,7 @@ @@ -103,6 +104,7 @@ @@ -156,13 +158,16 @@ @@ -295,6 +300,7 @@ @@ -406,6 +412,7 @@ @@ -449,8 +456,9 @@ - + @@ -483,6 +491,7 @@ @@ -562,8 +571,9 @@ - + @@ -595,8 +605,10 @@ @@ -626,6 +638,7 @@ @@ -774,6 +787,7 @@ @@ -869,13 +884,13 @@ + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> @@ -1028,11 +1043,11 @@ + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> @@ -1319,7 +1334,7 @@ + mouse_opaque="false" opaque="true" tear_off="true"> @@ -1464,7 +1479,7 @@ + mouse_opaque="false" opaque="true" tear_off="true"> - + - + @@ -1575,7 +1592,7 @@ + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> @@ -1826,7 +1843,7 @@ + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> + mouse_opaque="false" opaque="true" tear_off="true"> -- cgit v1.1