scroll-list column headers now work on single-click. Also improved focus handling for scroll-lists.

This commit is contained in:
Shyotl
2012-03-05 18:30:36 -06:00
parent d54c86e1df
commit 55e589375f
4 changed files with 31 additions and 3 deletions

View File

@@ -747,10 +747,10 @@ void LLComboBox::onButtonDown(void *userdata)
self->setFocus( TRUE );
// pass mouse capture on to list if button is depressed
if (self->mButton->hasMouseCapture())
/*if (self->mButton->hasMouseCapture())
{
gFocusMgr.setMouseCapture(self->mList);
}
}*/
}
else
{

View File

@@ -3300,6 +3300,12 @@ public:
// called to rebuild the draw label
virtual void buildDrawLabel( void );
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask)
{
LLMenuItemGL::handleMouseUp(x,y,mask);
return TRUE;
}
// doIt() - do the primary funcationality of the menu item.
virtual void doIt( void );
@@ -3448,6 +3454,18 @@ void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *fac
}
}
bool LLPieMenu::addChild(LLView* view, S32 tab_group)
{
if(LLMenuGL::addChild(view, tab_group))
{
LLMenuItemSeparatorGL* sep = dynamic_cast<LLMenuItemSeparatorGL*>(view);
if(sep)
sep->setVisible(false);
return true;
}
return false;
}
// virtual
void LLPieMenu::setVisible(BOOL visible)
{
@@ -3929,7 +3947,10 @@ LLMenuItemGL *LLPieMenu::pieItemFromXY(S32 x, S32 y)
{
if (which == 0)
{
return (*item_iter);
if((*item_iter)->getVisible())
return (*item_iter);
else
return NULL;
}
which--;
}

View File

@@ -697,6 +697,9 @@ public:
void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory);
// LLView Functionality
// hide separators. they are added to 'pad' in empty cells.
virtual bool addChild(LLView* view, S32 tab_group = 0);
// can't set visibility directly, must call show or hide
virtual void setVisible(BOOL visible);

View File

@@ -2135,6 +2135,8 @@ BOOL LLScrollListCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
mSelectionChanged = FALSE;
handleClick(x, y, mask);
setFocus(TRUE);
}
return TRUE;
@@ -3898,6 +3900,8 @@ void LLColumnHeader::onClick(void* user_data)
// propagate new sort order to sort order list
headerp->mList->selectNthItem(column->mParentCtrl->getSortAscending() ? 0 : 1);
headerp->mList->setFocus(TRUE);
}
//static