diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-10-19 14:09:23 +0300 | 
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-10-19 14:54:57 +0300 | 
| commit | 3f51c0423942f61d27c33bfdb1622e5ae2b8c9ae (patch) | |
| tree | 174104b8f9983c88ee4acc7874fb795ba1e95921 /indra | |
| parent | 80dd72ff2b30fd345482f0c2ede516e9b4bba8f3 (diff) | |
SL-14139 disallow Gestures from being bound to Ctrl+F10
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llpreviewgesture.cpp | 19 | ||||
| -rw-r--r-- | indra/newview/llpreviewgesture.h | 2 | 
2 files changed, 19 insertions, 2 deletions
| diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 70ce275734..18c2fb5452 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -373,11 +373,11 @@ BOOL LLPreviewGesture::postBuild()  	mReplaceEditor = edit;  	combo = getChild<LLComboBox>( "modifier_combo"); -	combo->setCommitCallback(onCommitSetDirty, this); +	combo->setCommitCallback(boost::bind(&LLPreviewGesture::onCommitKeyorModifier, this));  	mModifierCombo = combo;  	combo = getChild<LLComboBox>( "key_combo"); -	combo->setCommitCallback(onCommitSetDirty, this); +	combo->setCommitCallback(boost::bind(&LLPreviewGesture::onCommitKeyorModifier, this));  	mKeyCombo = combo;  	list = getChild<LLScrollListCtrl>("library_list"); @@ -937,12 +937,16 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture)  		break;  	} +	mModifierCombo->setEnabledByValue(CTRL_LABEL, gesture->mKey != KEY_F10); +  	mKeyCombo->setCurrentByIndex(0);  	if (gesture->mKey != KEY_NONE)  	{  		mKeyCombo->setSimple(LLKeyboard::stringFromKey(gesture->mKey));  	} +	mKeyCombo->setEnabledByValue(LLKeyboard::stringFromKey(KEY_F10), gesture->mMask != MASK_CONTROL); +  	// Make UI steps for each gesture step  	S32 i;  	S32 count = gesture->mSteps.size(); @@ -1338,6 +1342,17 @@ LLMultiGesture* LLPreviewGesture::createGesture()  } +void LLPreviewGesture::onCommitKeyorModifier() +{ +	// SL-14139: ctrl-F10 is currently used to access top menu, +	// so don't allow to bound gestures to this combination. + +	mKeyCombo->setEnabledByValue(LLKeyboard::stringFromKey(KEY_F10), mModifierCombo->getSimple() != CTRL_LABEL); +	mModifierCombo->setEnabledByValue(CTRL_LABEL, mKeyCombo->getSimple() != LLKeyboard::stringFromKey(KEY_F10)); +	mDirty = TRUE; +	refresh(); +} +  // static  void LLPreviewGesture::updateLabel(LLScrollListItem* item)  { diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index 3ba4f56295..ffcada4cc2 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -103,6 +103,8 @@ protected:  	LLScrollListItem* addStep(const enum EStepType step_type);  	void onVisibilityChanged ( const LLSD& new_visibility ); + +	void onCommitKeyorModifier();  	static std::string getLabel(std::vector<std::string> labels);  	static void updateLabel(LLScrollListItem* item); | 
