diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloateremojipicker.cpp | 62 | ||||
-rw-r--r-- | indra/newview/llfloateremojipicker.h | 2 |
2 files changed, 58 insertions, 6 deletions
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 2380fd357b..1578caa39c 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -953,6 +953,43 @@ void LLFloaterEmojiPicker::selectFocusedIcon() } } +bool LLFloaterEmojiPicker::moveFocusedIconUp() +{ + for (S32 i = mFocusedIconRow - 1; i >= 0; --i) + { + LLScrollingPanel* panel = mEmojiGrid->getPanelList()[i]; + LLEmojiGridRow* row = dynamic_cast<LLEmojiGridRow*>(panel); + if (row && row->mList->getPanelList().size() > mFocusedIconCol) + { + mEmojiScroll->scrollToShowRect(row->getBoundingRect()); + mFocusedIconRow = i; + selectFocusedIcon(); + return true; + } + } + + return false; +} + +bool LLFloaterEmojiPicker::moveFocusedIconDown() +{ + S32 rowCount = mEmojiGrid->getPanelList().size(); + for (S32 i = mFocusedIconRow + 1; i < rowCount; ++i) + { + LLScrollingPanel* panel = mEmojiGrid->getPanelList()[i]; + LLEmojiGridRow* row = dynamic_cast<LLEmojiGridRow*>(panel); + if (row && row->mList->getPanelList().size() > mFocusedIconCol) + { + mEmojiScroll->scrollToShowRect(row->getBoundingRect()); + mFocusedIconRow = i; + selectFocusedIcon(); + return true; + } + } + + return false; +} + bool LLFloaterEmojiPicker::moveFocusedIconPrev() { if (mHoveredIcon) @@ -1034,16 +1071,16 @@ BOOL LLFloaterEmojiPicker::handleKey(KEY key, MASK mask, BOOL called_from_parent { switch (key) { - case KEY_LEFT: - selectEmojiGroup((mSelectedGroupIndex + mFilteredEmojis.size()) % mGroupButtons.size()); + case KEY_UP: + moveFocusedIconUp(); return TRUE; - case KEY_RIGHT: - selectEmojiGroup((mSelectedGroupIndex + 1) % mGroupButtons.size()); + case KEY_DOWN: + moveFocusedIconDown(); return TRUE; - case KEY_UP: + case KEY_LEFT: moveFocusedIconPrev(); return TRUE; - case KEY_DOWN: + case KEY_RIGHT: moveFocusedIconNext(); return TRUE; case KEY_ESCAPE: @@ -1052,6 +1089,19 @@ BOOL LLFloaterEmojiPicker::handleKey(KEY key, MASK mask, BOOL called_from_parent } } + if (mask == MASK_ALT) + { + switch (key) + { + case KEY_LEFT: + selectEmojiGroup((mSelectedGroupIndex + mFilteredEmojis.size()) % mGroupButtons.size()); + return TRUE; + case KEY_RIGHT: + selectEmojiGroup((mSelectedGroupIndex + 1) % mGroupButtons.size()); + return TRUE; + } + } + if (key == KEY_RETURN) { U64 time = totalTime(); diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index f169d67a4e..5d0402ca83 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -85,6 +85,8 @@ private: void onEmojiMouseUp(LLUICtrl* ctrl); void selectFocusedIcon(); + bool moveFocusedIconUp(); + bool moveFocusedIconDown(); bool moveFocusedIconPrev(); bool moveFocusedIconNext(); |