Added mouse_wheel_opaque attribute for scroll_list. Made several advanced submenus tear-off-able. Updated menu hover logic (removed MAX_MOUSE_SLOPE_SUB_MENU check) to make menus behave more predictably to cursor movement. Improved menu handling when it runs off of screen (and only uses vertical flip if menu item is in lower half of screen)

This commit is contained in:
Shyotl
2012-03-03 22:11:53 -06:00
parent 9f2b668424
commit 2d75e8fda6
4 changed files with 45 additions and 8 deletions

View File

@@ -641,6 +641,7 @@ LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect,
: LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data),
mLineHeight(0),
mScrollLines(0),
mMouseWheelOpaque(true),
mPageLines(0),
mHeadingHeight(20),
mMaxSelectable(0),
@@ -1950,6 +1951,12 @@ BOOL LLScrollListCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks)
BOOL handled = FALSE;
// Pretend the mouse is over the scrollbar
handled = mScrollbar->handleScrollWheel( 0, 0, clicks );
if (mMouseWheelOpaque)
{
return TRUE;
}
return handled;
}
@@ -2842,6 +2849,8 @@ LLXMLNodePtr LLScrollListCtrl::getXML(bool save_children) const
node->createChild("draw_stripes", TRUE)->setBoolValue(mDrawStripes);
node->createChild("column_padding", TRUE)->setIntValue(mColumnPadding);
node->createChild("mouse_wheel_opaque", TRUE)->setBoolValue(mMouseWheelOpaque);
addColorXML(node, mBgWriteableColor, "bg_writeable_color", "ScrollBgWriteableColor");
addColorXML(node, mBgReadOnlyColor, "bg_read_only_color", "ScrollBgReadOnlyColor");
@@ -2969,6 +2978,9 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
BOOL sort_ascending = TRUE;
node->getAttributeBOOL("sort_ascending", sort_ascending);
BOOL mouse_wheel_opaque = TRUE;
node->getAttributeBOOL("mouse_wheel_opaque", mouse_wheel_opaque);
LLUICtrlCallback callback = NULL;
@@ -2993,6 +3005,8 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
scroll_list->initFromXML(node, parent);
scroll_list->setSearchColumn(search_column);
scroll_list->mMouseWheelOpaque = mouse_wheel_opaque;
LLSD columns;
S32 index = 0;