From 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:50 -0500 Subject: Second Life viewer sources 1.20.7 --- linden/indra/llui/llcombobox.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'linden/indra/llui/llcombobox.cpp') diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index 0523a11..d5edba7 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp @@ -565,6 +565,8 @@ void LLComboBox::showList() S32 min_width = getRect().getWidth(); S32 max_width = llmax(min_width, MAX_COMBO_WIDTH); + // make sure we have up to date content width metrics + mList->calcColumnWidths(); S32 list_width = llclamp(mList->getMaxContentWidth(), min_width, max_width); if (mListPosition == BELOW) @@ -781,8 +783,18 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) mList->highlightNthItem(mList->getItemIndex(last_selected_item)); } result = mList->handleKeyHere(key, mask); + + // will only see return key if it is originating from line editor + // since the dropdown button eats the key + if (key == KEY_RETURN) + { + // don't show list and don't eat key input when committing + // free-form text entry with RETURN since user already knows + // what they are trying to select + return FALSE; + } // if selection has changed, pop open list - if (mList->getLastSelectedItem() != last_selected_item) + else if (mList->getLastSelectedItem() != last_selected_item) { showList(); } -- cgit v1.1