Skip to content
Snippets Groups Projects
Commit fc9c9486 authored by Merov Linden's avatar Merov Linden
Browse files

EXP-1202 : pull from richard/viewer-experience-fui

parents b07e7c71 896ea6f8
No related branches found
No related tags found
No related merge requests found
...@@ -455,12 +455,42 @@ void LLFloaterReg::toggleFloaterInstance(const LLSD& sdname) ...@@ -455,12 +455,42 @@ void LLFloaterReg::toggleFloaterInstance(const LLSD& sdname)
//static //static
void LLFloaterReg::toggleToolbarFloaterInstance(const LLSD& sdname) void LLFloaterReg::toggleToolbarFloaterInstance(const LLSD& sdname)
{ {
// Do some extra logic here for 3-state toolbar floater toggling madness :) //
// Floaters controlled by the toolbar behave a bit differently from others.
// Namely they have 3-4 states as defined in the design wiki page here:
// https://wiki.lindenlab.com/wiki/FUI_Button_states
//
// The basic idea is this:
// * If the target floater is minimized, this button press will un-minimize it.
// * Else if the target floater is closed open it.
// * Else if the target floater does not have focus, give it focus.
// * Also, if it is not on top, bring it forward when focus is given.
// * Else the target floater is open, close it.
//
// First parse the parameter
LLSD key; LLSD key;
std::string name = sdname.asString(); std::string name = sdname.asString();
parse_name_key(name, key); parse_name_key(name, key);
toggleInstance(name, key);
LLFloater* instance = findInstance(name, key);
if (LLFloater::isMinimized(instance))
{
instance->setMinimized(FALSE);
}
else if (!LLFloater::isShown(instance))
{
showInstance(name, key, TRUE);
}
else if (!instance->hasFocus())
{
instance->setFocus(TRUE);
}
else
{
instance->closeFloater();
}
} }
//static //static
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment