From af827615acc6cce0457ba00810136c41283f6158 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 28 Nov 2014 10:00:41 -0500 Subject: STORM-2082 Initial support for presets popup from status bar --- indra/newview/llpanelpresetspulldown.cpp | 155 +++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 indra/newview/llpanelpresetspulldown.cpp (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp new file mode 100644 index 0000000000..d93afd674c --- /dev/null +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -0,0 +1,155 @@ +/** + * @file llpanelpresetspulldown.cpp + * @author Tofu Linden + * @brief A panel showing a quick way to pick presets + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelpresetspulldown.h" + +// Viewer libs +#include "llviewercontrol.h" +#include "llstatusbar.h" + +// Linden libs +#include "llbutton.h" +#include "lltabcontainer.h" +#include "llfloaterreg.h" +#include "llfloaterpreference.h" +#include "llsliderctrl.h" + +/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 4.0f; +/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 5.0f; + +///---------------------------------------------------------------------------- +/// Class LLPanelPresetsPulldown +///---------------------------------------------------------------------------- + +// Default constructor +LLPanelPresetsPulldown::LLPanelPresetsPulldown() +{ + mHoverTimer.stop(); + + mCommitCallbackRegistrar.add("Presets.GoMoveViewPrefs", boost::bind(&LLPanelPresetsPulldown::onMoveViewButtonClick, this, _2)); + mCommitCallbackRegistrar.add("Presets.GoGraphicsPrefs", boost::bind(&LLPanelPresetsPulldown::onGraphicsButtonClick, this, _2)); + buildFromFile( "panel_presets_pulldown.xml"); +} + +BOOL LLPanelPresetsPulldown::postBuild() +{ + return LLPanel::postBuild(); +} + +/*virtual*/ +void LLPanelPresetsPulldown::onMouseEnter(S32 x, S32 y, MASK mask) +{ + mHoverTimer.stop(); + LLPanel::onMouseEnter(x,y,mask); +} + +/*virtual*/ +void LLPanelPresetsPulldown::onTopLost() +{ + setVisible(FALSE); +} + +/*virtual*/ +void LLPanelPresetsPulldown::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mHoverTimer.start(); + LLPanel::onMouseLeave(x,y,mask); +} + +/*virtual*/ +void LLPanelPresetsPulldown::onVisibilityChange ( BOOL new_visibility ) +{ + if (new_visibility) + { + mHoverTimer.start(); // timer will be stopped when mouse hovers over panel + } + else + { + mHoverTimer.stop(); + + } +} + +void LLPanelPresetsPulldown::onMoveViewButtonClick(const LLSD& user_data) +{ + // close the minicontrol, we're bringing up the big one + setVisible(FALSE); + + // bring up the prefs floater + LLFloaterPreference* prefsfloater = dynamic_cast + (LLFloaterReg::showInstance("preferences")); + if (prefsfloater) + { + // grab the 'move' panel from the preferences floater and + // bring it the front! + LLTabContainer* tabcontainer = prefsfloater->getChild("pref core"); + LLPanel* movepanel = prefsfloater->getChild("move"); + if (tabcontainer && movepanel) + { + tabcontainer->selectTabPanel(movepanel); + } + } +} + +void LLPanelPresetsPulldown::onGraphicsButtonClick(const LLSD& user_data) +{ + // close the minicontrol, we're bringing up the big one + setVisible(FALSE); + + // bring up the prefs floater + LLFloaterPreference* prefsfloater = dynamic_cast + (LLFloaterReg::showInstance("preferences")); + if (prefsfloater) + { + // grab the 'graphics' panel from the preferences floater and + // bring it the front! + LLTabContainer* tabcontainer = prefsfloater->getChild("pref core"); + LLPanel* graphicspanel = prefsfloater->getChild("display"); + if (tabcontainer && graphicspanel) + { + tabcontainer->selectTabPanel(graphicspanel); + } + } +} + +//virtual +void LLPanelPresetsPulldown::draw() +{ + F32 alpha = mHoverTimer.getStarted() + ? clamp_rescale(mHoverTimer.getElapsedTimeF32(), sAutoCloseFadeStartTimeSec, sAutoCloseTotalTimeSec, 1.f, 0.f) + : 1.0f; + LLViewDrawContext context(alpha); + + LLPanel::draw(); + + if (alpha == 0.f) + { + setVisible(FALSE); + } +} -- cgit v1.2.3 From 34a79a6ece28fbc560bde907142ecaadf95e910f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 30 Nov 2014 07:15:00 -0500 Subject: STORM-2082 Implement delete floater --- indra/newview/llpanelpresetspulldown.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index d93afd674c..fc459a27e7 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -1,11 +1,10 @@ /** * @file llpanelpresetspulldown.cpp - * @author Tofu Linden * @brief A panel showing a quick way to pick presets * - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2014, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,11 +28,9 @@ #include "llpanelpresetspulldown.h" -// Viewer libs #include "llviewercontrol.h" #include "llstatusbar.h" -// Linden libs #include "llbutton.h" #include "lltabcontainer.h" #include "llfloaterreg.h" @@ -102,8 +99,7 @@ void LLPanelPresetsPulldown::onMoveViewButtonClick(const LLSD& user_data) setVisible(FALSE); // bring up the prefs floater - LLFloaterPreference* prefsfloater = dynamic_cast - (LLFloaterReg::showInstance("preferences")); + LLFloater* prefsfloater = LLFloaterReg::showInstance("preferences"); if (prefsfloater) { // grab the 'move' panel from the preferences floater and @@ -123,8 +119,7 @@ void LLPanelPresetsPulldown::onGraphicsButtonClick(const LLSD& user_data) setVisible(FALSE); // bring up the prefs floater - LLFloaterPreference* prefsfloater = dynamic_cast - (LLFloaterReg::showInstance("preferences")); + LLFloater* prefsfloater = LLFloaterReg::showInstance("preferences"); if (prefsfloater) { // grab the 'graphics' panel from the preferences floater and -- cgit v1.2.3 From 7360f046634d013fec1e9b37c60840a83b470ce1 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 1 Dec 2014 15:36:59 -0500 Subject: STORM-2082 Better control on how (or if) to display Default preset Make sure default preset is created when flyout panel is activated Only display deleted notification upon successful deletion --- indra/newview/llpanelpresetspulldown.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index fc459a27e7..977e9ff5e2 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -35,6 +35,7 @@ #include "lltabcontainer.h" #include "llfloaterreg.h" #include "llfloaterpreference.h" +#include "llpresetsmanager.h" #include "llsliderctrl.h" /* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 4.0f; @@ -56,6 +57,9 @@ LLPanelPresetsPulldown::LLPanelPresetsPulldown() BOOL LLPanelPresetsPulldown::postBuild() { + // Make sure there is a default preference file + LLPresetsManager::getInstance()->createMissingDefault(); + return LLPanel::postBuild(); } -- cgit v1.2.3 From cc22efa4c0d6b06bac6f49b6243df7726f89c7c4 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 3 Dec 2014 06:35:46 -0500 Subject: STORM-2082 Remove Apply button. Add new control variable to track which preset is active. Save settings to active preset when clicking on Ok button. Initial work to make pulldown operational. Still to do: add pretty icon for current preset. Notifications do not appear when called from this panel. --- indra/newview/llpanelpresetspulldown.cpp | 65 +++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 13 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 977e9ff5e2..cd049712e1 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -37,6 +37,7 @@ #include "llfloaterpreference.h" #include "llpresetsmanager.h" #include "llsliderctrl.h" +#include "llscrolllistctrl.h" /* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 4.0f; /* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 5.0f; @@ -50,19 +51,53 @@ LLPanelPresetsPulldown::LLPanelPresetsPulldown() { mHoverTimer.stop(); - mCommitCallbackRegistrar.add("Presets.GoMoveViewPrefs", boost::bind(&LLPanelPresetsPulldown::onMoveViewButtonClick, this, _2)); mCommitCallbackRegistrar.add("Presets.GoGraphicsPrefs", boost::bind(&LLPanelPresetsPulldown::onGraphicsButtonClick, this, _2)); + mCommitCallbackRegistrar.add("Presets.RowClick", boost::bind(&LLPanelPresetsPulldown::onRowClick, this, _2)); + buildFromFile( "panel_presets_pulldown.xml"); } BOOL LLPanelPresetsPulldown::postBuild() { + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPresetsPulldown::populatePanel, this)); // Make sure there is a default preference file LLPresetsManager::getInstance()->createMissingDefault(); + populatePanel(); + return LLPanel::postBuild(); } +void LLPanelPresetsPulldown::populatePanel() +{ + std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC); + LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_POSITION_NORMAL); + + LLScrollListCtrl* scroll = getChild("preset_list"); + + if (scroll && mPresetNames.begin() != mPresetNames.end()) + { + scroll->clearRows(); + + for (std::list::const_iterator it = mPresetNames.begin(); it != mPresetNames.end(); ++it) + { + const std::string& name = *it; + + LLSD row; + row["columns"][0]["column"] = "preset_name"; + row["columns"][0]["value"] = name; + + if (name == gSavedSettings.getString("PresetGraphicActive")) + { + row["columns"][1]["column"] = "active_name"; + row["columns"][1]["value"] = "X"; + } + + scroll->addElement(row); + } + } +} + /*virtual*/ void LLPanelPresetsPulldown::onMouseEnter(S32 x, S32 y, MASK mask) { @@ -97,22 +132,26 @@ void LLPanelPresetsPulldown::onVisibilityChange ( BOOL new_visibility ) } } -void LLPanelPresetsPulldown::onMoveViewButtonClick(const LLSD& user_data) +void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data) { - // close the minicontrol, we're bringing up the big one - setVisible(FALSE); + LLScrollListCtrl* scroll = getChild("preset_list"); - // bring up the prefs floater - LLFloater* prefsfloater = LLFloaterReg::showInstance("preferences"); - if (prefsfloater) + if (scroll) { - // grab the 'move' panel from the preferences floater and - // bring it the front! - LLTabContainer* tabcontainer = prefsfloater->getChild("pref core"); - LLPanel* movepanel = prefsfloater->getChild("move"); - if (tabcontainer && movepanel) + LLScrollListItem* item = scroll->getFirstSelected(); + if (item) { - tabcontainer->selectTabPanel(movepanel); + std::string name = item->getColumn(1)->getValue().asString(); + + LLPresetsManager::getInstance()->loadPreset(PRESETS_GRAPHIC, name); + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refreshEnabledGraphics(); + } + setVisible(FALSE); + // This line shouldn't be necessary but it is. + populatePanel(); } } } -- cgit v1.2.3 From afd12a6e784574e69ef3b3e7cac14573fe7c3197 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 3 Dec 2014 09:38:10 -0500 Subject: STORM-2082 Send signal to pulldown panel to refresh itself --- indra/newview/llpanelpresetspulldown.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index cd049712e1..093b5caad9 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -150,8 +150,6 @@ void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data) instance->refreshEnabledGraphics(); } setVisible(FALSE); - // This line shouldn't be necessary but it is. - populatePanel(); } } } -- cgit v1.2.3 From 5be238b127ff30f09105ad6f0d9b8ee3dec8b40f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 4 Dec 2014 14:27:15 -0500 Subject: STORM-2082 Revert name of Reset button from Undo back to Reset. Hopefully this will be renamed Recommended Settings. Display a test icon (artwork needed) in the pulldown panel --- indra/newview/llpanelpresetspulldown.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 093b5caad9..1918623cab 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -89,8 +89,9 @@ void LLPanelPresetsPulldown::populatePanel() if (name == gSavedSettings.getString("PresetGraphicActive")) { - row["columns"][1]["column"] = "active_name"; - row["columns"][1]["value"] = "X"; + row["columns"][1]["column"] = "icon"; + row["columns"][1]["type"] = "icon"; + row["columns"][1]["value"] = "Inv_Landmark"; } scroll->addElement(row); -- cgit v1.2.3 From 8d12072979ee46a1eb2d13fdfef8bef62ff3f619 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 12 Dec 2014 11:13:11 -0500 Subject: STORM-2082 Merge Hardware floater into main graphics preferences display Change notifications so they are emitted only when an error occurs Put active preset at top of list Add Maximum ARC slider Merge two small methods into slider update code --- indra/newview/llpanelpresetspulldown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 1918623cab..4756f3bd75 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -71,7 +71,7 @@ BOOL LLPanelPresetsPulldown::postBuild() void LLPanelPresetsPulldown::populatePanel() { std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC); - LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_POSITION_NORMAL); + LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_SHOW); LLScrollListCtrl* scroll = getChild("preset_list"); -- cgit v1.2.3 From d1bc2fe292edcea60b49ce8111a495974e9415a2 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 14 Jan 2015 19:55:58 -0500 Subject: STORM-2082 Assorted UI tweaks, better MaximumARC formula, pulldowns disappear faster --- indra/newview/llpanelpresetspulldown.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 4756f3bd75..66f2f4c3f3 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -39,8 +39,8 @@ #include "llsliderctrl.h" #include "llscrolllistctrl.h" -/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 4.0f; -/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 5.0f; +/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 2.0f; +/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 3.0f; ///---------------------------------------------------------------------------- /// Class LLPanelPresetsPulldown @@ -71,7 +71,7 @@ BOOL LLPanelPresetsPulldown::postBuild() void LLPanelPresetsPulldown::populatePanel() { std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC); - LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_SHOW); + LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_TOP); LLScrollListCtrl* scroll = getChild("preset_list"); @@ -91,7 +91,7 @@ void LLPanelPresetsPulldown::populatePanel() { row["columns"][1]["column"] = "icon"; row["columns"][1]["type"] = "icon"; - row["columns"][1]["value"] = "Inv_Landmark"; + row["columns"][1]["value"] = "Checkbox_On"; } scroll->addElement(row); -- cgit v1.2.3 From ce324355787bd9c1c864050ca54b4306c30a0e79 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 15 Jan 2015 16:43:43 -0500 Subject: STORM-2082 Use correct icon for checkmark Redo UI layout to indicate the two dependencies on the Imposters checkbox Reverse the ARC slider --- indra/newview/llpanelpresetspulldown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 66f2f4c3f3..2c5ae01b12 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -91,7 +91,7 @@ void LLPanelPresetsPulldown::populatePanel() { row["columns"][1]["column"] = "icon"; row["columns"][1]["type"] = "icon"; - row["columns"][1]["value"] = "Checkbox_On"; + row["columns"][1]["value"] = "Check_Mark"; } scroll->addElement(row); -- cgit v1.2.3 From 58577702a8c185683e089afc3f7fbcbaaf40122c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 20 Jan 2015 18:24:02 -0500 Subject: STORM-2082 Finally(?) deal properly with dirty UI processing. Code cleanup, some per bitbucket comments. --- indra/newview/llpanelpresetspulldown.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 2c5ae01b12..ceff5a54e8 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -145,11 +145,7 @@ void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data) std::string name = item->getColumn(1)->getValue().asString(); LLPresetsManager::getInstance()->loadPreset(PRESETS_GRAPHIC, name); - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->refreshEnabledGraphics(); - } + setVisible(FALSE); } } -- cgit v1.2.3 From 14408cc0dbe4eb079a9c19002f33c9ab6c5c5bba Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 23 Sep 2015 17:39:37 +0300 Subject: MAINT-5620 FIXED clicking on Graphics Preset title triggers favorite --- indra/newview/llpanelpresetspulldown.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index ceff5a54e8..a0bd8f5ad0 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -112,6 +112,13 @@ void LLPanelPresetsPulldown::onTopLost() setVisible(FALSE); } +/*virtual*/ +BOOL LLPanelPresetsPulldown::handleMouseDown(S32 x, S32 y, MASK mask) +{ + LLPanel::handleMouseDown(x,y,mask); + return TRUE; +} + /*virtual*/ void LLPanelPresetsPulldown::onMouseLeave(S32 x, S32 y, MASK mask) { -- cgit v1.2.3 From 453dee2d21477ad534fa9982b844c40adde9b93e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 28 Sep 2015 15:00:17 -0400 Subject: MAINT-5542: fix initialization of Default graphics preset so that it is selectable --- indra/newview/llpanelpresetspulldown.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index a0bd8f5ad0..ed67c34bd6 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -59,9 +59,10 @@ LLPanelPresetsPulldown::LLPanelPresetsPulldown() BOOL LLPanelPresetsPulldown::postBuild() { - LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPresetsPulldown::populatePanel, this)); + LLPresetsManager* presetsMgr = LLPresetsManager::getInstance(); + presetsMgr->setPresetListChangeCallback(boost::bind(&LLPanelPresetsPulldown::populatePanel, this)); // Make sure there is a default preference file - LLPresetsManager::getInstance()->createMissingDefault(); + presetsMgr->createMissingDefault(); populatePanel(); @@ -82,7 +83,8 @@ void LLPanelPresetsPulldown::populatePanel() for (std::list::const_iterator it = mPresetNames.begin(); it != mPresetNames.end(); ++it) { const std::string& name = *it; - + LL_DEBUGS() << "adding '" << name << "'" << LL_ENDL; + LLSD row; row["columns"][0]["column"] = "preset_name"; row["columns"][0]["value"] = name; @@ -151,11 +153,20 @@ void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data) { std::string name = item->getColumn(1)->getValue().asString(); + LL_DEBUGS() << "selected '" << name << "'" << LL_ENDL; LLPresetsManager::getInstance()->loadPreset(PRESETS_GRAPHIC, name); setVisible(FALSE); } + else + { + LL_DEBUGS() << "none selected" << LL_ENDL; + } } + else + { + LL_DEBUGS() << "no scroll" << LL_ENDL; + } } void LLPanelPresetsPulldown::onGraphicsButtonClick(const LLSD& user_data) -- cgit v1.2.3 From 14c91b939ef151e662d47892407c622c39f01d3a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 2 Nov 2015 18:58:17 +0200 Subject: MAINT-5620 double clicking on Graphics Preset title triggers favorite --- indra/newview/llpanelpresetspulldown.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index ed67c34bd6..175f281ca4 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -121,6 +121,20 @@ BOOL LLPanelPresetsPulldown::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } +/*virtual*/ +BOOL LLPanelPresetsPulldown::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + LLPanel::handleRightMouseDown(x, y, mask); + return TRUE; +} + +/*virtual*/ +BOOL LLPanelPresetsPulldown::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + LLPanel::handleDoubleClick(x, y, mask); + return TRUE; +} + /*virtual*/ void LLPanelPresetsPulldown::onMouseLeave(S32 x, S32 y, MASK mask) { -- cgit v1.2.3 From 448a8d1814b062cb1086c6915be291dfdbe1620e Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 19 Feb 2016 16:58:19 +0200 Subject: MAINT-6150 [QuickGraphics] Clicking the blank space in the quick graphics floater will select the first Preset --- indra/newview/llpanelpresetspulldown.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 175f281ca4..70f5fcd2c0 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -89,14 +89,18 @@ void LLPanelPresetsPulldown::populatePanel() row["columns"][0]["column"] = "preset_name"; row["columns"][0]["value"] = name; + bool is_selected_preset = false; if (name == gSavedSettings.getString("PresetGraphicActive")) { row["columns"][1]["column"] = "icon"; row["columns"][1]["type"] = "icon"; row["columns"][1]["value"] = "Check_Mark"; + + is_selected_preset = true; } - scroll->addElement(row); + LLScrollListItem* new_item = scroll->addElement(row); + new_item->setSelected(is_selected_preset); } } } -- cgit v1.2.3 From 6f799b0a587c53587edd1dbef8ec69ca974b9a85 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 10 Mar 2016 10:00:03 +0100 Subject: Fix default preset not shown as selected in quick graphics pulldown for non-english languages --- indra/newview/llpanelpresetspulldown.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelpresetspulldown.cpp') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 70f5fcd2c0..9b4dc5474a 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -38,6 +38,7 @@ #include "llpresetsmanager.h" #include "llsliderctrl.h" #include "llscrolllistctrl.h" +#include "lltrans.h" /* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 2.0f; /* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 3.0f; @@ -80,6 +81,12 @@ void LLPanelPresetsPulldown::populatePanel() { scroll->clearRows(); + std::string active_preset = gSavedSettings.getString("PresetGraphicActive"); + if (active_preset == PRESETS_DEFAULT) + { + active_preset = LLTrans::getString(PRESETS_DEFAULT); + } + for (std::list::const_iterator it = mPresetNames.begin(); it != mPresetNames.end(); ++it) { const std::string& name = *it; @@ -90,7 +97,7 @@ void LLPanelPresetsPulldown::populatePanel() row["columns"][0]["value"] = name; bool is_selected_preset = false; - if (name == gSavedSettings.getString("PresetGraphicActive")) + if (name == active_preset) { row["columns"][1]["column"] = "icon"; row["columns"][1]["type"] = "icon"; -- cgit v1.2.3