QuickPrefs is a TransientDockableFloater - let's make it actually behave like one and dock to the toolbar button, unless a legacy skin (Vintage or Latency) is used
parent
7cf0ca5a54
commit
4518d1011a
|
|
@ -413,3 +413,9 @@ bool FSCommon::isDefaultTexture(const LLUUID& asset_id)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FSCommon::isLegacySkin()
|
||||
{
|
||||
std::string current_skin = gSavedSettings.getString("SkinCurrent");
|
||||
return (current_skin == "vintage" || current_skin == "latency");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ namespace FSCommon
|
|||
std::string getAvatarNameByDisplaySettings(const LLAvatarName& av_name);
|
||||
|
||||
bool isDefaultTexture(const LLUUID& asset_id);
|
||||
|
||||
bool isLegacySkin();
|
||||
};
|
||||
|
||||
#endif // FS_COMMON_H
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@
|
|||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include "fscommon.h"
|
||||
#include "quickprefs.h"
|
||||
|
||||
LLToolBarView* gToolBarView = NULL;
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view");
|
||||
|
|
@ -130,9 +133,7 @@ BOOL LLToolBarView::postBuild()
|
|||
mBottomChatStack = findChild<LLView>("bottom_chat_stack");
|
||||
|
||||
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
|
||||
std::string current_skin = gSavedSettings.getString("SkinCurrent");
|
||||
mHideBottomOnEmpty = (current_skin == "vintage" || current_skin == "latency");
|
||||
// </FS:Ansariel>
|
||||
mHideBottomOnEmpty = FSCommon::isLegacySkin();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -544,6 +545,17 @@ void LLToolBarView::onToolBarButtonAdded(LLView* button)
|
|||
// to prevent hiding the transient IM floater upon pressing "Voice controls".
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(button);
|
||||
}
|
||||
// <FS:Ansariel> Dockable QuickPrefs floater
|
||||
else if (button->getName() == "quickprefs" && !FSCommon::isLegacySkin())
|
||||
{
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(button);
|
||||
FloaterQuickPrefs* quickprefs_floater = LLFloaterReg::getTypedInstance<FloaterQuickPrefs>("quickprefs");
|
||||
if (quickprefs_floater && quickprefs_floater->isShown())
|
||||
{
|
||||
quickprefs_floater->dockToToolbarButton();
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLToolBarView::onToolBarButtonRemoved(LLView* button)
|
||||
|
|
@ -581,6 +593,19 @@ void LLToolBarView::onToolBarButtonRemoved(LLView* button)
|
|||
{
|
||||
LLTransientFloaterMgr::getInstance()->removeControlView(button);
|
||||
}
|
||||
// <FS:Ansariel> Dockable QuickPrefs floater
|
||||
else if (button->getName() == "quickprefs" && !FSCommon::isLegacySkin())
|
||||
{
|
||||
LLTransientFloaterMgr::getInstance()->removeControlView(button);
|
||||
FloaterQuickPrefs* quickprefs_floater = LLFloaterReg::getTypedInstance<FloaterQuickPrefs>("quickprefs");
|
||||
if (quickprefs_floater && quickprefs_floater->isShown())
|
||||
{
|
||||
quickprefs_floater->setCanDock(false);
|
||||
LLDockControl* dock_control = quickprefs_floater->getDockControl();
|
||||
dock_control->setDock(NULL);
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLToolBarView::draw()
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "quickprefs.h"
|
||||
|
||||
#include "fscommon.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llcolorswatch.h"
|
||||
|
|
@ -97,6 +98,11 @@ FloaterQuickPrefs::FloaterQuickPrefs(const LLSD& key)
|
|||
{
|
||||
// For Phototools
|
||||
mCommitCallbackRegistrar.add("Quickprefs.ShaderChanged", boost::bind(&handleSetShaderChanged, LLSD()));
|
||||
|
||||
if (!getIsPhototools() && !FSCommon::isLegacySkin())
|
||||
{
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(this);
|
||||
}
|
||||
}
|
||||
|
||||
FloaterQuickPrefs::~FloaterQuickPrefs()
|
||||
|
|
@ -105,6 +111,11 @@ FloaterQuickPrefs::~FloaterQuickPrefs()
|
|||
{
|
||||
mRlvBehaviorCallbackConnection.disconnect();
|
||||
}
|
||||
|
||||
if (!getIsPhototools() && !FSCommon::isLegacySkin())
|
||||
{
|
||||
LLTransientFloaterMgr::getInstance()->removeControlView(this);
|
||||
}
|
||||
}
|
||||
|
||||
void FloaterQuickPrefs::onOpen(const LLSD& key)
|
||||
|
|
@ -140,6 +151,8 @@ void FloaterQuickPrefs::onOpen(const LLSD& key)
|
|||
}
|
||||
}
|
||||
// </FS:Zi>
|
||||
|
||||
dockToToolbarButton();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -375,7 +388,7 @@ BOOL FloaterQuickPrefs::postBuild()
|
|||
// bail out here if this is a reused Phototools floater
|
||||
if (getIsPhototools())
|
||||
{
|
||||
return LLDockableFloater::postBuild();
|
||||
return LLTransientDockableFloater::postBuild();
|
||||
}
|
||||
|
||||
// find the layout_stack to insert the controls into
|
||||
|
|
@ -432,7 +445,7 @@ BOOL FloaterQuickPrefs::postBuild()
|
|||
mControlNameCombo->sortByName();
|
||||
// </FS:Zi>
|
||||
|
||||
return LLDockableFloater::postBuild();
|
||||
return LLTransientDockableFloater::postBuild();
|
||||
}
|
||||
|
||||
void FloaterQuickPrefs::loadSavedSettingsFromFile(const std::string& settings_path)
|
||||
|
|
@ -653,7 +666,7 @@ void FloaterQuickPrefs::draw()
|
|||
|
||||
mWLSunPos->setCurSliderValue(val);
|
||||
|
||||
LLFloater::draw();
|
||||
LLTransientDockableFloater::draw();
|
||||
}
|
||||
|
||||
void FloaterQuickPrefs::onSunMoved()
|
||||
|
|
@ -1874,3 +1887,35 @@ void FloaterQuickPrefs::onClickRestoreDefaults()
|
|||
LLNotificationsUtil::add("ConfirmRestoreQuickPrefsDefaults", LLSD(), LLSD(), boost::bind(&FloaterQuickPrefs::callbackRestoreDefaults, this, _1, _2));
|
||||
}
|
||||
// </FS:CR>
|
||||
|
||||
void FloaterQuickPrefs::dockToToolbarButton()
|
||||
{
|
||||
LLCommandId command_id("quickprefs");
|
||||
S32 toolbar_loc = gToolBarView->hasCommand(command_id);
|
||||
|
||||
if (toolbar_loc != LLToolBarEnums::TOOLBAR_NONE && !FSCommon::isLegacySkin())
|
||||
{
|
||||
LLDockControl::DocAt doc_at = LLDockControl::TOP;
|
||||
switch (toolbar_loc)
|
||||
{
|
||||
case LLToolBarEnums::TOOLBAR_LEFT:
|
||||
doc_at = LLDockControl::RIGHT;
|
||||
break;
|
||||
|
||||
case LLToolBarEnums::TOOLBAR_RIGHT:
|
||||
doc_at = LLDockControl::LEFT;
|
||||
break;
|
||||
}
|
||||
setCanDock(true);
|
||||
LLView* anchor_panel = gToolBarView->findChildView("quickprefs");
|
||||
setUseTongue(anchor_panel);
|
||||
// Garbage collected by std::auto_ptr
|
||||
setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(doc_at), doc_at));
|
||||
}
|
||||
else
|
||||
{
|
||||
setUseTongue(false);
|
||||
setDockControl(NULL);
|
||||
setCanDock(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ public:
|
|||
void refreshSettings();
|
||||
bool getIsPhototools() const { return getName() == PHOTOTOOLS_FLOATER; };
|
||||
|
||||
void dockToToolbarButton();
|
||||
|
||||
private:
|
||||
|
||||
LLMultiSliderCtrl* mWLSunPos;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
positioning="centered"
|
||||
legacy_header_height="18"
|
||||
can_resize="false"
|
||||
can_dock="false"
|
||||
can_dock="true"
|
||||
can_close="true"
|
||||
height="160"
|
||||
width="260"
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
save_rect="true"
|
||||
save_visibility="true"
|
||||
single_instance="true"
|
||||
save_dock_state="false"
|
||||
save_dock_state="true"
|
||||
title="Quick Preferences">
|
||||
<panel
|
||||
name="quickprefs"
|
||||
|
|
|
|||
Loading…
Reference in New Issue