diff options
author | andreykproductengine <akleshchev@productengine.com> | 2017-01-30 20:02:59 +0200 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2017-01-30 20:02:59 +0200 |
commit | bd3815699cf107cd79a7d0db0d8298b356652add (patch) | |
tree | e551c0990866aed6984be381dddc600b0b457a73 /indra/newview | |
parent | ac784d669b5dbd617850854d89b31e0d82738413 (diff) |
MAINT-3216 Fixed "Vertical scale" does not change "Repeats per meter" on "Tab"
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelface.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 3 |
2 files changed, 26 insertions, 5 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index ec2d37c30d..ad600358dd 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -649,7 +649,7 @@ void LLPanelFace::getState() updateUI(); } -void LLPanelFace::updateUI() +void LLPanelFace::updateUI(bool force_set_values /*false*/) { //set state of UI to match state of texture entry(ies) (calls setEnabled, setValue, etc, but NOT setVisible) LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); @@ -1025,7 +1025,14 @@ void LLPanelFace::updateUI() getChildView("shinyScaleV")->setEnabled(editable && specmap_id.notNull()); getChildView("bumpyScaleV")->setEnabled(editable && normmap_id.notNull()); - getChild<LLUICtrl>("TexScaleV")->setValue(diff_scale_t); + if (force_set_values) + { + getChild<LLSpinCtrl>("TexScaleV")->forceSetValue(diff_scale_t); + } + else + { + getChild<LLSpinCtrl>("TexScaleV")->setValue(diff_scale_t); + } getChild<LLUICtrl>("shinyScaleV")->setValue(norm_scale_t); getChild<LLUICtrl>("bumpyScaleV")->setValue(spec_scale_t); @@ -1235,8 +1242,17 @@ void LLPanelFace::updateUI() BOOL repeats_tentative = !identical_repeats; getChildView("rptctrl")->setEnabled(identical_planar_texgen ? FALSE : enabled); - getChild<LLUICtrl>("rptctrl")->setValue(editable ? repeats : 1.0f); - getChild<LLUICtrl>("rptctrl")->setTentative(LLSD(repeats_tentative)); + LLSpinCtrl* rpt_ctrl = getChild<LLSpinCtrl>("rptctrl"); + if (force_set_values) + { + //onCommit, previosly edited element updates related ones + rpt_ctrl->forceSetValue(editable ? repeats : 1.0f); + } + else + { + rpt_ctrl->setValue(editable ? repeats : 1.0f); + } + rpt_ctrl->setTentative(LLSD(repeats_tentative)); } } @@ -1974,6 +1990,8 @@ void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata ) { LLPanelFace* self = (LLPanelFace*) userdata; self->sendTextureInfo(); + // vertical scale and repeats per meter depends on each other, so force set on changes + self->updateUI(true); } // Commit the number of repeats per meter @@ -2038,6 +2056,8 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) llassert(false); break; } + // vertical scale and repeats per meter depends on each other, so force set on changes + self->updateUI(true); } struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 9823e84cd9..078995e787 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -152,7 +152,8 @@ protected: // Make UI reflect state of currently selected material (refresh) // and UI mode (e.g. editing normal map v diffuse map) // - void updateUI(); + // @param force_set_values forces spinners to set value even if they are focused + void updateUI(bool force_set_values = false); // Convenience func to determine if all faces in selection have // identical planar texgen settings during edits |