From e057285ecd92d641776ce8c0183abee6027d8503 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 11 Oct 2016 09:45:49 +0200 Subject: [PATCH] Use CTRL-F focus the local search editor of a window if available (can be disabled via FSSelectLocalSearchEditorOnShortcut) --- indra/newview/app_settings/settings.xml | 33 ++++++++++++------- indra/newview/fscommon.cpp | 5 +++ indra/newview/fscommon.h | 2 ++ indra/newview/fsfloaterassetblacklist.cpp | 12 +++++++ indra/newview/fsfloaterassetblacklist.h | 2 ++ .../newview/fsfloateravatarrendersettings.cpp | 13 ++++++++ indra/newview/fsfloateravatarrendersettings.h | 2 ++ indra/newview/fsfloatercontacts.cpp | 11 +++++++ indra/newview/fsfloatercontacts.h | 2 ++ indra/newview/fsfloaterteleporthistory.cpp | 12 +++++++ indra/newview/fsfloaterteleporthistory.h | 2 ++ indra/newview/fspanelblocklist.cpp | 12 +++++++ indra/newview/fspanelblocklist.h | 2 ++ indra/newview/fspanelradar.cpp | 15 ++++++++- indra/newview/fspanelradar.h | 3 ++ indra/newview/llfloaterconversationlog.cpp | 14 ++++++++ indra/newview/llfloaterconversationlog.h | 5 +++ .../newview/llfloatermarketplacelistings.cpp | 14 ++++++++ indra/newview/llfloatermarketplacelistings.h | 4 +++ indra/newview/llpanelgroup.cpp | 29 ++++++++++++++++ indra/newview/llpanelgroup.h | 5 +++ indra/newview/llpanelgrouproles.cpp | 12 +++++++ indra/newview/llpanelgrouproles.h | 7 ++++ indra/newview/llpanelmaininventory.cpp | 9 +++++ indra/newview/llpanelmaininventory.h | 2 ++ indra/newview/llpanelpeople.cpp | 27 +++++++++++++++ indra/newview/llpanelpeople.h | 4 +++ indra/newview/llpanelplaces.cpp | 14 ++++++++ indra/newview/llpanelplaces.h | 4 +++ indra/newview/llsidepanelappearance.cpp | 22 +++++++++++++ indra/newview/llsidepanelappearance.h | 4 +++ indra/newview/lltexturectrl.cpp | 10 ++++++ indra/newview/lltexturectrl.h | 2 ++ 33 files changed, 304 insertions(+), 12 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 908ce1a637..f6f5540403 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24114,17 +24114,28 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 - FSMaxPendingIMMessages - - Comment - Maximum number of pending IM or group messages before a minimized or not visible chat window will be updated - Persist - 1 - Type - S32 - Value - 25 - + FSMaxPendingIMMessages + + Comment + Maximum number of pending IM or group messages before a minimized or not visible chat window will be updated + Persist + 1 + Type + S32 + Value + 25 + + FSSelectLocalSearchEditorOnShortcut + + Comment + If enabled, pressing the shortcut for search (CTRL-F) will focus the search field of the active window (if available). + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index 2df3b036a6..f8f6072793 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -421,3 +421,8 @@ bool FSCommon::isLegacySkin() std::string current_skin = gSavedSettings.getString("FSInternalSkinCurrent"); return (current_skin == "Vintage" || current_skin == "Latency"); } + +bool FSCommon::isFilterEditorKeyCombo(KEY key, MASK mask) +{ + return (mask == MASK_CONTROL && key == 'F' && gSavedSettings.getBOOL("FSSelectLocalSearchEditorOnShortcut")); +} diff --git a/indra/newview/fscommon.h b/indra/newview/fscommon.h index 50752931b1..3fa6b52bdd 100644 --- a/indra/newview/fscommon.h +++ b/indra/newview/fscommon.h @@ -84,6 +84,8 @@ namespace FSCommon bool isDefaultTexture(const LLUUID& asset_id); bool isLegacySkin(); + + bool isFilterEditorKeyCombo(KEY key, MASK mask); }; #endif // FS_COMMON_H diff --git a/indra/newview/fsfloaterassetblacklist.cpp b/indra/newview/fsfloaterassetblacklist.cpp index d46e8254d7..890c7a79de 100644 --- a/indra/newview/fsfloaterassetblacklist.cpp +++ b/indra/newview/fsfloaterassetblacklist.cpp @@ -30,6 +30,7 @@ #include "fsfloaterassetblacklist.h" +#include "fscommon.h" #include "fsscrolllistctrl.h" #include "llfiltereditor.h" #include "llfloaterreg.h" @@ -221,6 +222,17 @@ void FSFloaterAssetBlacklist::onFilterEdit(const std::string& search_string) mResultList->setFilterString(mFilterSubStringOrig); } +BOOL FSFloaterAssetBlacklist::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + getChild("filter_input")->setFocus(TRUE); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} + //--------------------------------------------------------------------------- // Context menu //--------------------------------------------------------------------------- diff --git a/indra/newview/fsfloaterassetblacklist.h b/indra/newview/fsfloaterassetblacklist.h index 02160daf1a..83ffc020f7 100644 --- a/indra/newview/fsfloaterassetblacklist.h +++ b/indra/newview/fsfloaterassetblacklist.h @@ -45,6 +45,8 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } void addElementToList(const LLUUID& id, const LLSD& data); void removeElements(); diff --git a/indra/newview/fsfloateravatarrendersettings.cpp b/indra/newview/fsfloateravatarrendersettings.cpp index 88f380bcff..e751f4ef97 100644 --- a/indra/newview/fsfloateravatarrendersettings.cpp +++ b/indra/newview/fsfloateravatarrendersettings.cpp @@ -29,6 +29,7 @@ #include "fsfloateravatarrendersettings.h" +#include "fscommon.h" #include "llfiltereditor.h" #include "llnamelistctrl.h" #include "lltrans.h" @@ -133,6 +134,18 @@ void FSFloaterAvatarRenderSettings::onFilterEdit(const std::string& search_strin mAvatarList->setFilterString(mFilterSubStringOrig); } +BOOL FSFloaterAvatarRenderSettings::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + getChild("filter_input")->setFocus(TRUE); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} + + //--------------------------------------------------------------------------- // Context menu //--------------------------------------------------------------------------- diff --git a/indra/newview/fsfloateravatarrendersettings.h b/indra/newview/fsfloateravatarrendersettings.h index 75d70308e2..4217a6f714 100644 --- a/indra/newview/fsfloateravatarrendersettings.h +++ b/indra/newview/fsfloateravatarrendersettings.h @@ -43,6 +43,8 @@ public: virtual ~FSFloaterAvatarRenderSettings(); /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } private: void onCloseBtn(); diff --git a/indra/newview/fsfloatercontacts.cpp b/indra/newview/fsfloatercontacts.cpp index 4ccb5f0e4f..9c00991bd0 100644 --- a/indra/newview/fsfloatercontacts.cpp +++ b/indra/newview/fsfloatercontacts.cpp @@ -190,6 +190,17 @@ BOOL FSFloaterContacts::tick() return FALSE; } +BOOL FSFloaterContacts::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask) && getActiveTabName() == FRIENDS_TAB_NAME && gSavedSettings.getBOOL("FSContactListShowSearch")) + { + mFriendFilter->setFocus(TRUE); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} + void FSFloaterContacts::updateGroupButtons() { LLUUID groupId = getCurrentItemID(); diff --git a/indra/newview/fsfloatercontacts.h b/indra/newview/fsfloatercontacts.h index 777e053fe5..3f1c0fd99e 100644 --- a/indra/newview/fsfloatercontacts.h +++ b/indra/newview/fsfloatercontacts.h @@ -52,6 +52,8 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void draw(); /*virtual*/ BOOL tick(); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } // LLFriendObserver implementation /*virtual*/ void changed(U32 changed_mask); diff --git a/indra/newview/fsfloaterteleporthistory.cpp b/indra/newview/fsfloaterteleporthistory.cpp index b26c1c3928..1cd6930645 100644 --- a/indra/newview/fsfloaterteleporthistory.cpp +++ b/indra/newview/fsfloaterteleporthistory.cpp @@ -29,6 +29,7 @@ #include "fsfloaterteleporthistory.h" +#include "fscommon.h" #include "llpanelteleporthistory.h" #include "llbutton.h" #include "llfiltereditor.h" @@ -105,3 +106,14 @@ void FSFloaterTeleportHistory::resetFilter() mFilterEditor->clear(); onFilterEdit("", true); } + +BOOL FSFloaterTeleportHistory::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + mFilterEditor->setFocus(TRUE); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} diff --git a/indra/newview/fsfloaterteleporthistory.h b/indra/newview/fsfloaterteleporthistory.h index 4933795992..dbdb915719 100644 --- a/indra/newview/fsfloaterteleporthistory.h +++ b/indra/newview/fsfloaterteleporthistory.h @@ -40,6 +40,8 @@ public: virtual ~FSFloaterTeleportHistory(); BOOL postBuild(); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } void resetFilter(); diff --git a/indra/newview/fspanelblocklist.cpp b/indra/newview/fspanelblocklist.cpp index 05fe7009df..9048eeea46 100644 --- a/indra/newview/fspanelblocklist.cpp +++ b/indra/newview/fspanelblocklist.cpp @@ -31,6 +31,7 @@ #include "fspanelblocklist.h" +#include "fscommon.h" #include "fsblocklistmenu.h" #include "fsscrolllistctrl.h" #include "llavataractions.h" @@ -116,6 +117,17 @@ void FSPanelBlockList::onOpen(const LLSD& key) } } +BOOL FSPanelBlockList::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + getChild("blocked_filter_input")->setFocus(TRUE); + return TRUE; + } + + return LLPanel::handleKeyHere(key, mask); +} + void FSPanelBlockList::selectBlocked(const LLUUID& mute_id) { mBlockedList->deselectAllItems(); diff --git a/indra/newview/fspanelblocklist.h b/indra/newview/fspanelblocklist.h index 0816ffba8e..0d81a55a02 100644 --- a/indra/newview/fspanelblocklist.h +++ b/indra/newview/fspanelblocklist.h @@ -48,6 +48,8 @@ public: virtual BOOL postBuild(); virtual void onOpen(const LLSD& key); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } void selectBlocked(const LLUUID& id); diff --git a/indra/newview/fspanelradar.cpp b/indra/newview/fspanelradar.cpp index aede0032b2..ab78fb9ce4 100644 --- a/indra/newview/fspanelradar.cpp +++ b/indra/newview/fspanelradar.cpp @@ -36,6 +36,7 @@ #include "lltoggleablemenu.h" // newview +#include "fscommon.h" #include "fsradarmenu.h" #include "llavataractions.h" #include "llnetmap.h" @@ -132,7 +133,8 @@ BOOL FSPanelRadar::postBuild() mMiniMap = getChild("Net Map"); mAddFriendButton = getChild("add_friend_btn"); - getChild("nearby_filter_input")->setCommitCallback(boost::bind(&FSPanelRadar::onFilterEdit, this, _2)); + mFilterEditor = getChild("nearby_filter_input"); + mFilterEditor->setCommitCallback(boost::bind(&FSPanelRadar::onFilterEdit, this, _2)); // Create menus. LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -169,6 +171,17 @@ BOOL FSPanelRadar::postBuild() return TRUE; } +BOOL FSPanelRadar::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + mFilterEditor->setFocus(TRUE); + return TRUE; + } + + return LLPanel::handleKeyHere(key, mask); +} + void FSPanelRadar::updateButtons() { LLUUID selected_id; diff --git a/indra/newview/fspanelradar.h b/indra/newview/fspanelradar.h index fefb27fb4e..06550237cc 100644 --- a/indra/newview/fspanelradar.h +++ b/indra/newview/fspanelradar.h @@ -49,6 +49,8 @@ public: virtual ~FSPanelRadar(); /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } void requestUpdate(); LLUUID getCurrentItemID() const; @@ -86,6 +88,7 @@ private: LLButton* mRadarGearButton; LLButton* mAddFriendButton; LLMenuButton* mOptionsButton; + LLFilterEditor* mFilterEditor; LLHandle mOptionsMenuHandle; diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp index a1356544ce..6aaa97b1a0 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -34,6 +34,7 @@ #include "llviewercontrol.h" #include "llavataractions.h" // +#include "fscommon.h" LLFloaterConversationLog::LLFloaterConversationLog(const LLSD& key) : LLFloater(key), @@ -135,3 +136,16 @@ bool LLFloaterConversationLog::isActionChecked(const LLSD& userdata) return false; } + +// CTRL-F focusses local search editor +BOOL LLFloaterConversationLog::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + getChild("people_filter_input")->setFocus(TRUE); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} +// diff --git a/indra/newview/llfloaterconversationlog.h b/indra/newview/llfloaterconversationlog.h index e971330f3d..9815961ccb 100644 --- a/indra/newview/llfloaterconversationlog.h +++ b/indra/newview/llfloaterconversationlog.h @@ -43,6 +43,11 @@ public: void onFilterEdit(const std::string& search_string); + // CTRL-F focusses local search editor + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } + // + private: void onCustomAction (const LLSD& userdata); diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 18f0bc4498..3887efb0a3 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -43,6 +43,7 @@ #include "llsidepaneliteminfo.h" #include "lltextbox.h" #include "lltrans.h" +#include "fscommon.h" ///---------------------------------------------------------------------------- /// LLPanelMarketplaceListings @@ -673,6 +674,19 @@ void LLFloaterMarketplaceListings::onChanged() } } +// CTRL-F focusses local search editor +BOOL LLFloaterMarketplaceListings::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + getChild("filter_editor")->setFocus(TRUE); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} +// + //----------------------------------------------------------------------------- // LLFloaterAssociateListing //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index ffc098e28a..f7a738822b 100644 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -109,6 +109,10 @@ public: BOOL handleHover(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); + // CTRL-F focusses local search editor + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } + // protected: void setRootFolder(); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index dcc37d1fd3..12adf0bc28 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -60,6 +60,7 @@ #include "fsfloatergroup.h" #include "llviewercontrol.h" // +#include "fscommon.h" static LLPanelInjector t_panel_group("panel_group_info_sidetray"); @@ -846,4 +847,32 @@ void LLPanelGroup::showNotice(const std::string& subject, } +// CTRL-F focusses local search editor +BOOL LLPanelGroup::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + if (mIsUsingTabContainer) + { + LLPanelGroupRoles* panel = dynamic_cast(getChild("groups_accordion")->getCurrentPanel()); + if (panel) + { + panel->getCurrentTab()->setSearchFilterFocus(TRUE); + return TRUE; + } + } + else + { + LLAccordionCtrlTab* tab = getChild("groups_accordion")->getSelectedTab(); + if (tab && tab->getName() == "group_roles_tab") + { + tab->findChild("group_roles_tab_panel")->getCurrentTab()->setSearchFilterFocus(TRUE); + return TRUE; + } + } + } + + return LLPanel::handleKeyHere(key, mask); +} +// diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index ae157cfbad..ee34197cdc 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -88,6 +88,11 @@ public: const std::string& inventory_name, LLOfferInfo* inventory_offer); + // CTRL-F focusses local search editor + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } + // + protected: virtual void update(LLGroupChange gc); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 48403afd8a..cba1f5db7f 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -431,6 +431,12 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) activate(); } +// CTRL-F focusses local search editor +LLPanelGroupSubTab* LLPanelGroupRoles::getCurrentTab() const +{ + return dynamic_cast(mSubTabContainer->getCurrentPanel()); +} +// // LLPanelGroupSubTab //////////////////////////////////////////////////// LLPanelGroupSubTab::LLPanelGroupSubTab() @@ -789,6 +795,12 @@ void LLPanelGroupSubTab::setFooterEnabled(BOOL enable) } } +// CTRL-F focusses local search editor +void LLPanelGroupSubTab::setSearchFilterFocus(BOOL focus) +{ + mSearchEditor->setFocus(focus); +} +// // LLPanelGroupMembersSubTab ///////////////////////////////////////////// static LLPanelInjector t_panel_group_members_subtab("panel_group_members_subtab"); diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 06469818b9..0e37ef874b 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -80,6 +80,9 @@ public: virtual void setGroupID(const LLUUID& id); + // CTRL-F focusses local search editor + LLPanelGroupSubTab* getCurrentTab() const; + protected: LLPanelGroupTab* mCurrentTab; LLPanelGroupTab* mRequestedTab; @@ -114,6 +117,10 @@ public: void setFooterEnabled(BOOL enable); virtual void setGroupID(const LLUUID& id); + + // CTRL-F focusses local search editor + void setSearchFilterFocus(BOOL focus); + protected: void buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fcb1cc5f73..5250b0bafa 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -62,6 +62,7 @@ #include "lltrans.h" #include "llviewernetwork.h" // +#include "fscommon.h" // FIRE-12808: Don't save filters during settings restore bool LLPanelMainInventory::sSaveFilters = true; @@ -403,6 +404,14 @@ void LLPanelMainInventory::startSearch() BOOL LLPanelMainInventory::handleKeyHere(KEY key, MASK mask) { + // CTRL-F focusses local search editor + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + mFilterEditor->setFocus(TRUE); + return TRUE; + } + // + LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL; if (root_folder) { diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 3e57341263..5d5e3414f3 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -75,6 +75,8 @@ public: /*virtual*/ void changed(U32); /*virtual*/ void draw(); /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); + // CTRL-F focusses local search editor + /*virtual*/ bool hasAccelerators() const { return true; } LLInventoryPanel* getPanel() { return mActivePanel; } LLInventoryPanel* getActivePanel() { return mActivePanel; } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e0df2275d8..7d9a83b7d0 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -2095,4 +2095,31 @@ bool LLPanelPeople::onEnableColumnVisibilityChecked(const LLSD& userdata) } // +// CTRL-F focusses local search editor +BOOL LLPanelPeople::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + std::string cur_tab = getActiveTabName(); + + if (cur_tab == FRIENDS_TAB_NAME) + { + getChild("friends_filter_input")->setFocus(TRUE); + return TRUE; + } + else if (cur_tab == GROUP_TAB_NAME) + { + getChild("groups_filter_input")->setFocus(TRUE); + return TRUE; + } + else if (cur_tab == RECENT_TAB_NAME) + { + getChild("recent_filter_input")->setFocus(TRUE); + return TRUE; + } + } + + return LLPanel::handleKeyHere(key, mask); +} +// // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index ea3ca077c9..60b018ae70 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -66,6 +66,10 @@ public: // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + // CTRL-F focusses local search editor + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } + // bool mTryToConnectToFacebook; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 2a9a52a31a..5e9a7b1a40 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -74,6 +74,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "fsfloaterplacedetails.h" +#include "fscommon.h" // Constants static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; @@ -1251,6 +1252,19 @@ void LLPanelPlaces::resetFilter() } // +// CTRL-F focusses local search editor +BOOL LLPanelPlaces::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + mFilterEditor->setFocus(TRUE); + return TRUE; + } + + return LLPanel::handleKeyHere(key, mask); +} +// + static bool is_agent_in_selected_parcel(LLParcel* parcel) { LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 0df8f3fec5..634ebccfcd 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -59,6 +59,10 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + // CTRL-F focusses local search editor + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } + // // Called on parcel selection change to update place information. void changedParcelSelection(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 1d90960bf1..ba0323dfe6 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -48,6 +48,7 @@ #include "llviewerregion.h" #include "llvoavatarself.h" #include "llviewerwearable.h" +#include "fscommon.h" static LLPanelInjector t_appearance("sidepanel_appearance"); @@ -573,3 +574,24 @@ void LLSidepanelAppearance::updateAvatarComplexity(U32 complexity) instance->mLastAvatarComplexity = complexity; } // + +// CTRL-F focusses local search editor +BOOL LLSidepanelAppearance::handleKeyHere(KEY key, MASK mask) +{ + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + if (mFilterEditor->getVisible()) + { + mFilterEditor->setFocus(TRUE); + return TRUE; + } + else if (isOutfitEditPanelVisible() && getChildView("filter_panel")->getVisible()) + { + getChild("look_item_filter")->setFocus(TRUE); + return TRUE; + } + } + + return LLPanel::handleKeyHere(key, mask); +} +// diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 3b113b9e79..9b4812c8d3 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -48,6 +48,10 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + // CTRL-F focusses local search editor + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool hasAccelerators() const { return true; } + // void refreshCurrentOutfitName(const std::string& name = ""); diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4d0ae2864f..965a310740 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -71,6 +71,8 @@ #include "lllocalbitmaps.h" #include "llerror.h" +#include "fscommon.h" + static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; static const F32 CONTEXT_FADE_TIME = 0.08f; @@ -272,6 +274,14 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) { + // CTRL-F focusses local search editor + if (FSCommon::isFilterEditorKeyCombo(key, mask)) + { + mFilterEdit->setFocus(TRUE); + return TRUE; + } + // + LLFolderView* root_folder = mInventoryPanel->getRootFolder(); if (root_folder && mFilterEdit) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 08e014ab1c..108bcb0d62 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -278,6 +278,8 @@ public: std::string& tooltip_msg); /*virtual*/ void draw(); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + // CTRL-F focusses local search editor + /*virtual*/ bool hasAccelerators() const { return true; } // LLFloater overrides /*virtual*/ BOOL postBuild();