diff options
author | James Cook <james@lindenlab.com> | 2009-07-06 21:58:04 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-07-06 21:58:04 +0000 |
commit | d6101558a171dbd2390792ac1e78d09fc2c27711 (patch) | |
tree | e5fea96c850fb254237c2869f2234fc4a4367e98 /indra/llui/llcombobox.cpp | |
parent | 39905b927d60e204438705728d2c214cb3f9ef81 (diff) |
Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux.
svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r-- | indra/llui/llcombobox.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 51ab3326fe..e19eacb774 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -83,12 +83,12 @@ LLComboBox::Params::Params() : allow_text_entry("allow_text_entry", false), show_text_as_tentative("show_text_as_tentative", true), max_chars("max_chars", 20), - arrow_image("arrow_image"), list_position("list_position", BELOW), items("item"), combo_button("combo_button"), combo_list("combo_list"), - combo_editor("combo_editor") + combo_editor("combo_editor"), + drop_down_button("drop_down_button") { addSynonym(items, "combo_item"); } @@ -104,19 +104,29 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p) mPrearrangeCallback(p.prearrange_callback()), mTextEntryCallback(p.text_entry_callback()), mSelectionCallback(p.selection_callback()), - mArrowImage(p.arrow_image), mListPosition(p.list_position) { // Text label button - LLButton::Params button_params = p.combo_button; + LLButton::Params button_params = (mAllowTextEntry ? p.combo_button : p.drop_down_button); button_params.mouse_down_callback.function(boost::bind(&LLComboBox::onButtonDown, this)); button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); button_params.rect(p.rect); - button_params.pad_right(2); + + if(mAllowTextEntry) + { + button_params.pad_right(2); + } + + mArrowImage = button_params.image_unselected; mButton = LLUICtrlFactory::create<LLButton>(button_params); - mButton->setRightHPad(2); //redo to compensate for button hack that leaves space for a character + if(mAllowTextEntry) + { + //redo to compensate for button hack that leaves space for a character + //unless it is a "minimal combobox"(drop down) + mButton->setRightHPad(2); + } addChild(mButton); LLScrollListCtrl::Params params = p.combo_list; |