SL-20211 EmojiPicker - Move the filter field to the top of the floater

master
Alexander Gavriliuk 2023-09-16 16:09:25 +02:00
parent 0e135d2a2c
commit 771d409b08
3 changed files with 25 additions and 11 deletions

View File

@ -193,7 +193,7 @@ public:
F32 centerX = 0.5f * iconWidth;
F32 centerY = 0.5f * clientHeight;
drawIcon(centerX, centerY, iconWidth);
drawIcon(centerX, centerY - 1, iconWidth);
static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f);
LLColor4 textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor);
@ -291,6 +291,8 @@ BOOL LLFloaterEmojiPicker::postBuild()
mPreview->setVisible(FALSE);
addChild(mPreview);
mDummy = getChild<LLTextBox>("Dummy");
mGroups = getChild<LLPanel>("Groups");
mBadge = getChild<LLPanel>("Badge");
@ -318,8 +320,9 @@ void LLFloaterEmojiPicker::dirtyRect()
if (!mFilter)
return;
const S32 PADDING = 4;
LLRect rect(PADDING, mFilter->getRect().mTop, getRect().getWidth() - PADDING * 2, PADDING);
const S32 HPADDING = 4;
const S32 VOFFSET = 12;
LLRect rect(HPADDING, mDummy->getRect().mTop + 6, getRect().getWidth() - HPADDING, VOFFSET);
if (mPreview->getRect() != rect)
{
mPreview->setRect(rect);
@ -596,7 +599,7 @@ void LLFloaterEmojiPicker::onFilterChanged()
void LLFloaterEmojiPicker::onGridMouseEnter()
{
mFilter->setVisible(FALSE);
mDummy->setVisible(FALSE);
mPreview->setEmoji(nullptr);
mPreview->setVisible(TRUE);
}
@ -604,8 +607,7 @@ void LLFloaterEmojiPicker::onGridMouseEnter()
void LLFloaterEmojiPicker::onGridMouseLeave()
{
mPreview->setVisible(FALSE);
mFilter->setVisible(TRUE);
mFilter->setFocus(TRUE);
mDummy->setVisible(TRUE);
}
void LLFloaterEmojiPicker::onGroupButtonMouseEnter(LLUICtrl* ctrl)

View File

@ -86,6 +86,7 @@ private:
class LLScrollContainer* mEmojiScroll { nullptr };
class LLScrollingPanelList* mEmojiGrid { nullptr };
class LLEmojiPreviewPanel* mPreview { nullptr };
class LLTextBox* mDummy { nullptr };
pick_callback_t mEmojiPickCallback;
close_callback_t mFloaterCloseCallback;

View File

@ -15,9 +15,9 @@
<filter_editor
name="Filter"
label="Start typing to filter"
layout="bottomleft"
follows="bottom|left|right"
bottom="14"
layout="topleft"
follows="top|left|right"
top="27"
left="10"
height="23"
width="230" />
@ -25,9 +25,9 @@
name="EmojiGridContainer"
layout="topleft"
follows="all"
top="25"
top="50"
left="0"
height="325"
height="300"
width="250">
<scrolling_panel_list
name="EmojiGrid"
@ -59,4 +59,15 @@
width="20"
/>
</panel>
<text
name="Dummy"
type="string"
layout="bottomleft"
follows="bottom|left|right"
halign="center"
valign="center"
bottom="14"
left="10"
height="23"
width="230">No emoji selected</text>
</floater>