summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychatbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnearbychatbar.cpp')
-rw-r--r--indra/newview/llnearbychatbar.cpp55
1 files changed, 50 insertions, 5 deletions
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 1507b7d324..46f531fdd9 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -34,6 +34,7 @@
#include "message.h"
+#include "llappviewer.h"
#include "llfloaterreg.h"
#include "lltrans.h"
@@ -69,6 +70,33 @@ static LLChatTypeTrigger sChatTypeTriggers[] = {
{ "/shout" , CHAT_TYPE_SHOUT}
};
+//ext-7367
+//Problem: gesture list control (actually LLScrollListCtrl) didn't actually process mouse wheel message.
+// introduce new gesture list subclass to "eat" mouse wheel messages (and probably some other messages)
+class LLGestureScrollListCtrl: public LLScrollListCtrl
+{
+protected:
+ friend class LLUICtrlFactory;
+ LLGestureScrollListCtrl(const LLScrollListCtrl::Params& params)
+ :LLScrollListCtrl(params)
+ {
+ }
+public:
+ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks)
+ {
+ LLScrollListCtrl::handleScrollWheel( x, y, clicks );
+ return TRUE;
+ }
+ //See EXT-6598
+ //Mouse hover over separator will result in not processing tooltip message
+ //So eat this message
+ BOOL handleToolTip(S32 x, S32 y, MASK mask)
+ {
+ LLScrollListCtrl::handleToolTip( x, y, mask );
+ return TRUE;
+ }
+};
+
LLGestureComboList::Params::Params()
: combo_button("combo_button"),
combo_list("combo_list")
@@ -79,6 +107,7 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p)
: LLUICtrl(p)
, mLabel(p.label)
, mViewAllItemIndex(0)
+ , mGetMoreItemIndex(0)
{
LLButton::Params button_params = p.combo_button;
button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT);
@@ -89,13 +118,14 @@ LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p)
addChild(mButton);
- LLScrollListCtrl::Params params = p.combo_list;
+ LLGestureScrollListCtrl::Params params(p.combo_list);
+
params.name("GestureComboList");
params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2));
params.visible(false);
params.commit_on_keyboard_movement(false);
- mList = LLUICtrlFactory::create<LLScrollListCtrl>(params);
+ mList = LLUICtrlFactory::create<LLGestureScrollListCtrl>(params);
addChild(mList);
//****************************Gesture Part********************************/
@@ -260,9 +290,12 @@ void LLGestureComboList::refreshGestures()
sortByName();
- // store index followed by the last added Gesture and add View All item at bottom
- mViewAllItemIndex = idx;
-
+ // store indices for Get More and View All items (idx is the index followed by the last added Gesture)
+ mGetMoreItemIndex = idx;
+ mViewAllItemIndex = idx + 1;
+
+ // add Get More and View All items at the bottom
+ mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex));
mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex));
// Insert label after sorting, at top, with separator below it
@@ -318,6 +351,12 @@ void LLGestureComboList::onCommitGesture()
return;
}
+ if (mGetMoreItemIndex == index)
+ {
+ LLWeb::loadURLExternal(gSavedSettings.getString("GesturesMarketplaceURL"));
+ return;
+ }
+
LLMultiGesture* gesture = mGestures.at(index);
if(gesture)
{
@@ -350,6 +389,7 @@ BOOL LLNearbyChatBar::postBuild()
mChatBox->setCommitCallback(boost::bind(&LLNearbyChatBar::onChatBoxCommit, this));
mChatBox->setKeystrokeCallback(&onChatBoxKeystroke, this);
mChatBox->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, _1, this));
+ mChatBox->setFocusReceivedCallback(boost::bind(&LLNearbyChatBar::onChatBoxFocusReceived, this));
mChatBox->setIgnoreArrowKeys( FALSE );
mChatBox->setCommitOnFocusLost( FALSE );
@@ -507,6 +547,11 @@ void LLNearbyChatBar::onChatBoxFocusLost(LLFocusableElement* caller, void* userd
gAgent.stopTyping();
}
+void LLNearbyChatBar::onChatBoxFocusReceived()
+{
+ mChatBox->setEnabled(!gDisconnected);
+}
+
EChatType LLNearbyChatBar::processChatTypeTriggers(EChatType type, std::string &str)
{
U32 length = str.length();