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-enginemaster
parent
e235e71b90
commit
a325df0898
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
clear_button_visible="false"
|
||||
search_button_visible="true"
|
||||
text_pad_left="6"
|
||||
text_pad_right="6"
|
||||
select_on_focus="true"
|
||||
text_tentative_color="TextFgTentativeColor"
|
||||
background_image="TextField_Search_Off"
|
||||
|
|
@ -21,5 +22,6 @@
|
|||
image_unselected="Icon_Close_Foreground"
|
||||
image_selected="Icon_Close_Press"
|
||||
pad_right="4"
|
||||
pad_left="4"
|
||||
width="16" />
|
||||
</search_editor>
|
||||
|
|
|
|||
Loading…
Reference in New Issue