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
meow-7.2.2
Arrehn 2011-01-28 00:37:10 -05:00
parent 2dc911ac0c
commit 3774c0d6ba
2 changed files with 10 additions and 5 deletions

View File

@ -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<LLPanel>("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;

View File

@ -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<LLPanel>("showMinimized"))
if (!res->hasChild("showMinimized"))
res->setHideOnMinimize(true);
}