From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/newview/llviewercontrol.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview/llviewercontrol.cpp') diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 86e58d1..e1aa3ae 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp @@ -105,7 +105,7 @@ BOOL LLFloaterSettingsDebug::postBuild() childSetUserData("boolean_combo", this); childSetCommitCallback("color_swatch", onCommitSettings); childSetUserData("color_swatch", this); - + childSetAction("default_btn", onClickDefault, this); mComment = (LLTextEditor*)getChildByName("comment_text"); return TRUE; } @@ -129,7 +129,7 @@ void LLFloaterSettingsDebug::show(void*) gUICtrlFactory->buildFloater(sInstance, "floater_settings_debug.xml"); } - sInstance->open(); + sInstance->open(); /* Flawfinder: ignore */ } //static @@ -217,6 +217,20 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data) } } +// static +void LLFloaterSettingsDebug::onClickDefault(void* user_data) +{ + LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; + LLComboBox* settings_combo = (LLComboBox*)floaterp->getChildByName("settings_combo"); + LLControlBase* controlp = (LLControlBase*)settings_combo->getCurrentUserdata(); + + if (controlp) + { + controlp->resetToDefault(); + floaterp->updateControl(controlp); + } +} + // we've switched controls, or doing per-frame update, so update spinners, etc. void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) { @@ -440,6 +454,8 @@ void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) if (!spinner4->hasFocus()) { spinner4->setPrecision(3); + spinner4->setMinValue(0.0); + spinner4->setMaxValue(1.f); spinner4->setValue(clr.mV[VALPHA]); } break; -- cgit v1.1