From 031032fb892560a0f5fa1a996aea77f593f54704 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 29 Aug 2023 13:12:09 +0200 Subject: SL-20211 EmojiPicker - The search field should be the same as other floaters --- indra/llui/llsearcheditor.cpp | 4 ++++ indra/newview/llfloateremojipicker.cpp | 10 +++++----- indra/newview/llfloateremojipicker.h | 4 ++-- indra/newview/skins/default/xui/en/floater_emoji_picker.xml | 9 ++------- 4 files changed, 13 insertions(+), 14 deletions(-) (limited to 'indra') diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index bafeef41fb..cfaf08ec0a 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -178,6 +178,10 @@ void LLSearchEditor::setFocus( BOOL b ) void LLSearchEditor::onClearButtonClick(const LLSD& data) { setText(LLStringUtil::null); + if (mTextChangedCallback) + { + mTextChangedCallback(this, getValue()); + } mSearchEditor->onCommit(); // force keystroke callback } diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index c3344fc18a..af807ba7cf 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -31,9 +31,9 @@ #include "llbutton.h" #include "llcombobox.h" #include "llemojidictionary.h" +#include "llfiltereditor.h" #include "llfloaterreg.h" #include "llkeyboard.h" -#include "lllineeditor.h" #include "llscrollcontainer.h" #include "llscrollingpanellist.h" #include "llscrolllistctrl.h" @@ -294,9 +294,9 @@ BOOL LLFloaterEmojiPicker::postBuild() mGroups = getChild("Groups"); mBadge = getChild("Badge"); - mFilter = getChild("Filter"); - mFilter->setKeystrokeCallback([this](LLLineEditor*, void*) { onSearchKeystroke(); }, NULL); - mFilter->setFont(LLViewerChat::getChatFont()); + mFilter = getChild("Filter"); + mFilter->setKeystrokeCallback([this](LLUICtrl*, const LLSD&) { onFilterChanged(); }); + mFilter->setTextChangedCallback([this](LLUICtrl*, const LLSD&) { onFilterChanged(); }); mFilter->setText(sFilterPattern); mEmojiScroll = getChild("EmojiGridContainer"); @@ -588,7 +588,7 @@ void LLFloaterEmojiPicker::onGroupButtonClick(LLUICtrl* ctrl) } } -void LLFloaterEmojiPicker::onSearchKeystroke() +void LLFloaterEmojiPicker::onFilterChanged() { sFilterPattern = mFilter->getText(); fillEmojis(); diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index e4b1216ce6..3cae818e15 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -60,7 +60,7 @@ private: void fillEmojis(bool fromResize = false); void onGroupButtonClick(LLUICtrl* ctrl); - void onSearchKeystroke(); + void onFilterChanged(); void onGridMouseEnter(); void onGridMouseLeave(); void onGroupButtonMouseEnter(LLUICtrl* ctrl); @@ -81,7 +81,7 @@ private: class LLPanel* mGroups { nullptr }; class LLPanel* mBadge { nullptr }; - class LLLineEditor* mFilter { nullptr }; + class LLFilterEditor* mFilter { nullptr }; class LLScrollContainer* mEmojiScroll { nullptr }; class LLScrollingPanelList* mEmojiGrid { nullptr }; class LLEmojiPreviewPanel* mPreview { nullptr }; diff --git a/indra/newview/skins/default/xui/en/floater_emoji_picker.xml b/indra/newview/skins/default/xui/en/floater_emoji_picker.xml index a2a290c306..6c440de573 100644 --- a/indra/newview/skins/default/xui/en/floater_emoji_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_emoji_picker.xml @@ -12,19 +12,14 @@ width="250"> -