Skip to content
Snippets Groups Projects
Commit 3f51c042 authored by Mnikolenko Productengine's avatar Mnikolenko Productengine
Browse files

SL-14139 disallow Gestures from being bound to Ctrl+F10

parent 80dd72ff
No related branches found
No related tags found
No related merge requests found
......@@ -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)
{
......
......@@ -103,6 +103,8 @@ class LLPreviewGesture : public LLPreview
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment