summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-02-25 19:39:16 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-02-25 19:39:16 +0200
commita325df08987636b00a5e81f08ee1d2a532636d72 (patch)
treee47efd37a3a796bf30e608891367adf6ecb25f20 /indra/llui
parente235e71b907d7fa4d6bd15852e0a3eae3cbd07c5 (diff)
Fixed bug EXT-5580 (Characters in Inventory Filter appear behind X).
Added configurable text right padding support to search_filter: * When the Clear button is enabled (i.e. search_editor.clear_button_visible set to "true") the search_editor.clear_button.pad_left parameter determines the padding. * Otherwise search_editor.text_pad_right is used. --HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llsearcheditor.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp
index 8075575bab..ec2ad5e5fa 100644
--- a/indra/llui/llsearcheditor.cpp
+++ b/indra/llui/llsearcheditor.cpp
@@ -44,17 +44,28 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height;
S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad;
LLRect srch_btn_rect(p.search_button.left_pad, srch_btn_top, srch_btn_right, p.search_button.top_pad);
+
+ S32 clr_btn_top = p.clear_button.rect.bottom + p.clear_button.rect.height;
+ S32 clr_btn_right = getRect().getWidth() - p.clear_button.pad_right;
+ S32 clr_btn_left = clr_btn_right - p.clear_button.rect.width;
+ LLRect clear_btn_rect(clr_btn_left, clr_btn_top, clr_btn_right, p.clear_button.rect.bottom);
+
S32 text_pad_left = p.text_pad_left;
+ S32 text_pad_right = p.text_pad_right;
if (p.search_button_visible)
text_pad_left += srch_btn_rect.getWidth();
+ if (p.clear_button_visible)
+ text_pad_right = getRect().getWidth() - clr_btn_left + p.clear_button.pad_left;
+
// Set up line editor.
LLLineEditor::Params line_editor_params(p);
line_editor_params.name("filter edit box");
line_editor_params.rect(getLocalRect());
line_editor_params.follows.flags(FOLLOWS_ALL);
line_editor_params.text_pad_left(text_pad_left);
+ line_editor_params.text_pad_right(text_pad_right);
line_editor_params.revert_on_esc(false);
line_editor_params.commit_callback.function(boost::bind(&LLUICtrl::onCommit, this));
line_editor_params.keystroke_callback(boost::bind(&LLSearchEditor::handleKeystroke, this));
@@ -82,10 +93,6 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
// Set up clear button.
LLButton::Params clr_btn_params(p.clear_button);
clr_btn_params.name(std::string("clear button"));
- S32 clr_btn_top = clr_btn_params.rect.bottom + clr_btn_params.rect.height;
- S32 clr_btn_right = getRect().getWidth() - clr_btn_params.pad_right;
- S32 clr_btn_left = clr_btn_right - clr_btn_params.rect.width;
- LLRect clear_btn_rect(clr_btn_left, clr_btn_top, clr_btn_right, p.clear_button.rect.bottom);
clr_btn_params.rect(clear_btn_rect) ;
clr_btn_params.follows.flags(FOLLOWS_RIGHT|FOLLOWS_TOP);
clr_btn_params.tab_stop(false);