From 3774c0d6ba3c43f96c51d8e9e2addd93cb396b2e Mon Sep 17 00:00:00 2001 From: Arrehn Date: Fri, 28 Jan 2011 00:37:10 -0500 Subject: [PATCH] Minor refactoring: Improved method of checking for sidebar tabs that should be visible when minimized. TODO: Better refactoring, this behavior should be in a floater attribute. --HG-- branch : Firestorm_2.4.1 --- indra/llui/llfloater.cpp | 9 ++++++--- indra/llui/llfloaterreg.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c158a979f9..a71beaecc4 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1062,10 +1062,13 @@ void LLFloater::setMinimized(BOOL minimize) if (minimize) { - // AO Pseudo-hide minimized sidebar floaters. We get into trouble if they are actually not-visible, - // so fake invisibility with offscreen location. + // AO: Pseudo-hide minimized sidebar floaters. We get into trouble if they are actually not visible, + // so fake invisibility with tiny sizign and out of the way location. + // At the moment we flag this pseudo hiding with the presence of a dummy control in floater_side_bar_tab.xml + // this should be refactored into a floater attribute. LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", getName()); - if (LLFloater::isShown(floater_tab) && (!getChild("showMinimized"))) + llinfos << "Minimizing " << floater_tab << ". showMinimizedPanel= " << hasChild("showMinimized", false) << llendl; + if (LLFloater::isShown(floater_tab) && !hasChild("showMinimized", false)) { mHideOnMinimize = true; llinfos << "SideTray minimized floater " << getName() << " detected, hiding." << llendl; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 20b95ac4ae..2de10eb75e 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -137,13 +137,15 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res->mKey = key; res->setInstanceName(name); - // handle restored undocked sidebar tabs specially + // AO: Mark certain floaters (sidebar tab floaters) as needing to be pseudo-hidden on minimization. + // At the moment we flag this pseudo hiding with the presence of a dummy control in floater_side_bar_tab.xml + // and the name of the floater window. This should be refactored into a floater attribute. llinfos << "trying to restore variables for name: " << name << llendl; std::string pat = "side_bar_tab"; size_t found = name.find(pat); if (found!=std::string::npos) { - if (!res->getChild("showMinimized")) + if (!res->hasChild("showMinimized")) res->setHideOnMinimize(true); }