summaryrefslogtreecommitdiff
path: root/indra/llui/llcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r--indra/llui/llcombobox.cpp41
1 files changed, 9 insertions, 32 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index ce25ee32b3..4a6e3c9a13 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -702,13 +702,20 @@ void LLComboBox::onListMouseUp()
void LLComboBox::onItemSelected(const LLSD& data)
{
- setValue(data);
+ const std::string name = mList->getSelectedItemLabel();
- if (mAllowTextEntry && mLastSelectedIndex != -1)
+ S32 cur_id = getCurrentIndex();
+ mLastSelectedIndex = cur_id;
+ if (cur_id != -1)
+ {
+ setLabel(name);
+
+ if (mAllowTextEntry)
{
gFocusMgr.setKeyboardFocus(mTextEntry);
mTextEntry->selectAll();
}
+ }
// hiding the list reasserts the old value stored in the text editor/dropdown button
hideList();
@@ -1061,33 +1068,3 @@ BOOL LLComboBox::selectItemRange( S32 first, S32 last )
{
return mList->selectItemRange(first, last);
}
-
-
-static LLDefaultChildRegistry::Register<LLIconsComboBox> register_icons_combo_box("icons_combo_box");
-
-LLIconsComboBox::Params::Params()
-: icon_column("icon_column", ICON_COLUMN),
- label_column("label_column", LABEL_COLUMN)
-{}
-
-LLIconsComboBox::LLIconsComboBox(const LLIconsComboBox::Params& p)
-: LLComboBox(p),
- mIconColumnIndex(p.icon_column),
- mLabelColumnIndex(p.label_column)
-{}
-
-void LLIconsComboBox::setValue(const LLSD& value)
-{
- BOOL found = mList->selectByValue(value);
- if (found)
- {
- LLScrollListItem* item = mList->getFirstSelected();
- if (item)
- {
- mButton->setImageOverlay(mList->getSelectedItemLabel(mIconColumnIndex), mButton->getImageOverlayHAlign());
-
- setLabel(mList->getSelectedItemLabel(mLabelColumnIndex));
- }
- mLastSelectedIndex = mList->getFirstSelectedIndex();
- }
-}