Merge skinning-15 to viewer-2. Fixes include:
DEV-35175 Spawning context menu should not move mouse cursor (Note: introduces regression where menu can fall off bottom of screen, will fix shortly) DEV-35143 Modal alerts appear behind side tray DEV-35141 Landmarks image and description outside of landmarks Merging revisions 126418-126419,126726-126727,126856-126857,127010-127011,127014-127016 of svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-15 into G:\viewer-2.0.0-3, respecting ancestrymaster
parent
9ecdbd8b72
commit
83a6ea234f
|
|
@ -631,7 +631,7 @@ void LLFloater::closeFloater(bool app_quitting)
|
|||
}
|
||||
|
||||
// Let floater do cleanup.
|
||||
mCloseSignal(this, getValue());
|
||||
mCloseSignal(this, getValue(), app_quitting);
|
||||
onClose(app_quitting);
|
||||
}
|
||||
}
|
||||
|
|
@ -1730,7 +1730,7 @@ void LLFloater::initOpenCallback(const OpenCallbackParam& cb, open_signal_t& sig
|
|||
else
|
||||
{
|
||||
std::string function_name = cb.function_name;
|
||||
open_callback_t* func = (CallbackRegistry<open_callback_t>::getValue(function_name));
|
||||
open_callback_t* func = (OpenCallbackRegistry::getValue(function_name));
|
||||
if (func)
|
||||
{
|
||||
if (cb.parameter.isProvided())
|
||||
|
|
@ -1745,6 +1745,45 @@ void LLFloater::initOpenCallback(const OpenCallbackParam& cb, open_signal_t& sig
|
|||
}
|
||||
}
|
||||
|
||||
void LLFloater::initCloseCallback(const CloseCallbackParam& cb, close_signal_t& sig)
|
||||
{
|
||||
if (cb.function.isProvided())
|
||||
{
|
||||
if (cb.parameter.isProvided())
|
||||
sig.connect(boost::bind(cb.function(), _1, cb.parameter, _3));
|
||||
else
|
||||
sig.connect(cb.function());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string function_name = cb.function_name;
|
||||
close_callback_t* func = (CloseCallbackRegistry::getValue(function_name));
|
||||
if (func)
|
||||
{
|
||||
if (cb.parameter.isProvided())
|
||||
sig.connect(boost::bind((*func), _1, cb.parameter,_3));
|
||||
else
|
||||
sig.connect(*func);
|
||||
}
|
||||
else if (!function_name.empty())
|
||||
{
|
||||
llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace LLInitParam
|
||||
{
|
||||
|
||||
template<>
|
||||
bool ParamCompare<LLFloater::close_callback_t>::equals(
|
||||
const LLFloater::close_callback_t &a,
|
||||
const LLFloater::close_callback_t &b)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// LLFloaterView
|
||||
|
||||
|
|
@ -2505,7 +2544,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
|
|||
initOpenCallback(p.open_callback, mOpenSignal);
|
||||
// close callback
|
||||
if (p.close_callback.isProvided())
|
||||
initOpenCallback(p.close_callback, mCloseSignal);
|
||||
initCloseCallback(p.close_callback, mCloseSignal);
|
||||
}
|
||||
|
||||
void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, BOOL open_floater, LLXMLNodePtr output_node)
|
||||
|
|
|
|||
|
|
@ -108,14 +108,19 @@ public:
|
|||
typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> open_callback_t;
|
||||
typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> open_signal_t;
|
||||
|
||||
typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> close_callback_t;
|
||||
typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> close_signal_t;
|
||||
|
||||
typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param, bool app_quitting)> close_callback_t;
|
||||
typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param, bool app_quitting)> close_signal_t;
|
||||
|
||||
struct OpenCallbackParam : public LLInitParam::Block<OpenCallbackParam, CallbackParam >
|
||||
{
|
||||
Optional<open_callback_t> function;
|
||||
};
|
||||
|
||||
|
||||
struct CloseCallbackParam : public LLInitParam::Block<CloseCallbackParam, CallbackParam >
|
||||
{
|
||||
Optional<close_callback_t> function;
|
||||
};
|
||||
|
||||
struct Params
|
||||
: public LLInitParam::Block<Params, LLPanel::Params>
|
||||
{
|
||||
|
|
@ -132,8 +137,8 @@ public:
|
|||
save_rect,
|
||||
save_visibility;
|
||||
|
||||
Optional<OpenCallbackParam> open_callback,
|
||||
close_callback;
|
||||
Optional<OpenCallbackParam> open_callback;
|
||||
Optional<CloseCallbackParam> close_callback;
|
||||
|
||||
Params() :
|
||||
title("title"),
|
||||
|
|
@ -306,6 +311,7 @@ protected:
|
|||
void destroy() { die(); } // Don't call this directly. You probably want to call close(). JC
|
||||
|
||||
void initOpenCallback(const OpenCallbackParam& cb, open_signal_t& sig);
|
||||
void initCloseCallback(const CloseCallbackParam& cb, close_signal_t& sig);
|
||||
|
||||
private:
|
||||
void setForeground(BOOL b); // called only by floaterview
|
||||
|
|
@ -318,13 +324,14 @@ private:
|
|||
void addDragHandle();
|
||||
|
||||
public:
|
||||
typedef CallbackRegistry<open_callback_t> OpenCallbackRegistry;
|
||||
class OpenCallbackRegistry : public CallbackRegistry<open_callback_t, OpenCallbackRegistry> {};
|
||||
class CloseCallbackRegistry : public CallbackRegistry<close_callback_t, CloseCallbackRegistry> {};
|
||||
|
||||
protected:
|
||||
std::string mRectControl;
|
||||
std::string mVisibilityControl;
|
||||
open_signal_t mOpenSignal;
|
||||
open_signal_t mCloseSignal;
|
||||
close_signal_t mCloseSignal;
|
||||
LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg
|
||||
|
||||
private:
|
||||
|
|
@ -486,6 +493,15 @@ public:
|
|||
|
||||
extern LLFloaterView* gFloaterView;
|
||||
|
||||
namespace LLInitParam
|
||||
{
|
||||
template<>
|
||||
bool ParamCompare<LLFloater::close_callback_t>::equals(
|
||||
const LLFloater::close_callback_t &a,
|
||||
const LLFloater::close_callback_t &b);
|
||||
}
|
||||
|
||||
|
||||
#endif // LL_FLOATER_H
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3532,7 +3532,7 @@ void LLContextMenuBranch::showSubMenu()
|
|||
S32 center_x;
|
||||
S32 center_y;
|
||||
localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y);
|
||||
mBranch->show( center_x, center_y, FALSE);
|
||||
mBranch->show( center_x, center_y);
|
||||
}
|
||||
|
||||
// onCommit() - do the primary funcationality of the menu item.
|
||||
|
|
@ -3580,7 +3580,7 @@ void LLContextMenu::setVisible(BOOL visible)
|
|||
hide();
|
||||
}
|
||||
|
||||
void LLContextMenu::show(S32 x, S32 y,BOOL adjustCursor)
|
||||
void LLContextMenu::show(S32 x, S32 y)
|
||||
{
|
||||
arrangeAndClear();
|
||||
|
||||
|
|
@ -3604,12 +3604,6 @@ void LLContextMenu::show(S32 x, S32 y,BOOL adjustCursor)
|
|||
const_cast<LLRect&>(getRect()).setCenterAndSize(local_x + width/2, local_y - height/2, width, height);
|
||||
arrange();
|
||||
|
||||
|
||||
if (translateIntoRect(menu_region_rect,FALSE) && adjustCursor)
|
||||
{
|
||||
LLUI::setCursorPositionLocal(getParent(), getRect().mLeft , getRect().mTop);
|
||||
}
|
||||
|
||||
LLView::setVisible(TRUE);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -659,7 +659,7 @@ public:
|
|||
|
||||
virtual void draw ();
|
||||
|
||||
virtual void show (S32 x, S32 y, BOOL adjustCursor = TRUE);
|
||||
virtual void show (S32 x, S32 y);
|
||||
virtual void hide ();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -418,10 +418,11 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
|
|||
|
||||
void LLPanel::initFromParams(const LLPanel::Params& p)
|
||||
{
|
||||
// The LLPanel constructor doesn't correctly receive Params yet
|
||||
setEnabled(p.enabled);
|
||||
//setting these here since panel constructor not called with params
|
||||
//and LLView::initFromParams will use them to set visible and enabled
|
||||
setVisible(p.visible);
|
||||
|
||||
setEnabled(p.enabled);
|
||||
|
||||
// control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible
|
||||
LLUICtrl::initFromParams(p);
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ void LLUICtrl::initFromParams(const Params& p)
|
|||
}
|
||||
else
|
||||
{
|
||||
commit_callback_t* initfunc = (CallbackRegistry<commit_callback_t>::getValue(p.init_callback.function_name));
|
||||
commit_callback_t* initfunc = (CommitCallbackRegistry::getValue(p.init_callback.function_name));
|
||||
if (initfunc)
|
||||
{
|
||||
(*initfunc)(this, p.init_callback.parameter);
|
||||
|
|
@ -233,7 +233,7 @@ void LLUICtrl::initCommitCallback(const CommitCallbackParam& cb, commit_signal_t
|
|||
else
|
||||
{
|
||||
std::string function_name = cb.function_name;
|
||||
commit_callback_t* func = (CallbackRegistry<commit_callback_t>::getValue(function_name));
|
||||
commit_callback_t* func = (CommitCallbackRegistry::getValue(function_name));
|
||||
if (func)
|
||||
{
|
||||
if (cb.parameter.isProvided())
|
||||
|
|
|
|||
|
|
@ -269,11 +269,11 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template <typename F> class CallbackRegistry : public LLRegistrySingleton<std::string, F, CallbackRegistry<F> >
|
||||
template <typename F, typename DERIVED> class CallbackRegistry : public LLRegistrySingleton<std::string, F, DERIVED >
|
||||
{};
|
||||
|
||||
typedef CallbackRegistry<commit_callback_t> CommitCallbackRegistry;
|
||||
typedef CallbackRegistry<enable_callback_t> EnableCallbackRegistry;
|
||||
class CommitCallbackRegistry : public CallbackRegistry<commit_callback_t, CommitCallbackRegistry>{};
|
||||
class EnableCallbackRegistry : public CallbackRegistry<enable_callback_t, EnableCallbackRegistry>{};
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
|||
|
|
@ -401,32 +401,28 @@ bool LLCompareByTabOrder::operator() (const LLView* const a, const LLView* const
|
|||
return (a_score == b_score) ? a < b : a_score < b_score;
|
||||
}
|
||||
|
||||
BOOL LLView::isInVisibleChain() const
|
||||
bool LLView::trueToRoot(const boost::function<bool (const LLView*)>& predicate) const
|
||||
{
|
||||
const LLView* cur_view = this;
|
||||
while(cur_view)
|
||||
{
|
||||
if (!cur_view->getVisible())
|
||||
if(!predicate(cur_view))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
cur_view = cur_view->getParent();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL LLView::isInVisibleChain() const
|
||||
{
|
||||
return trueToRoot(&LLView::getVisible);
|
||||
}
|
||||
|
||||
BOOL LLView::isInEnabledChain() const
|
||||
{
|
||||
const LLView* cur_view = this;
|
||||
while(cur_view)
|
||||
{
|
||||
if (!cur_view->getEnabled())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
cur_view = cur_view->getParent();
|
||||
}
|
||||
return TRUE;
|
||||
return trueToRoot(&LLView::getEnabled);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ public:
|
|||
S32 getDefaultTabGroup() const { return mDefaultTabGroup; }
|
||||
S32 getLastTabGroup() { return mLastTabGroup; }
|
||||
|
||||
bool trueToRoot(const boost::function<bool (const LLView*)>& predicate) const;
|
||||
BOOL isInVisibleChain() const;
|
||||
BOOL isInEnabledChain() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,8 @@ std::string LLFloaterUIPreview::mSavedDiffPath = std::string("");
|
|||
static const S32 PRIMARY_FLOATER = 1;
|
||||
static const S32 SECONDARY_FLOATER = 2;
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLOverlapPanel> register_overlap_panel("overlap_panel");
|
||||
|
||||
static std::string get_xui_dir()
|
||||
{
|
||||
std::string delim = gDirUtilp->getDirDelimiter();
|
||||
|
|
@ -186,11 +188,6 @@ BOOL LLFadeEventTimer::tick()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void* create_overlap_panel(void* data)
|
||||
{
|
||||
return new LLOverlapPanel();
|
||||
}
|
||||
|
||||
// Constructor
|
||||
LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
|
|
@ -204,7 +201,6 @@ LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key)
|
|||
|
||||
{
|
||||
sInstance = this;
|
||||
mFactoryMap["overlap_panel"] = LLCallbackMap(create_overlap_panel, NULL);
|
||||
// called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ui_preview.xml");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
#include "lllistview.h"
|
||||
|
||||
#include "lltextbox.h"
|
||||
#include "lluictrlfactory.h" // LLDefaultWidgetRegistry
|
||||
#include "lluictrlfactory.h" // LLDefaultChildRegistry
|
||||
|
||||
// linker optimizes this out on Windows until there is a real reference
|
||||
// to this file
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
#include "llviewerregion.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
|
||||
|
||||
void addLocationHistory()
|
||||
{
|
||||
LLVector3 position = gAgent.getPositionAgent();
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ BOOL LLPanelPicks::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
mPopupMenu->buildDrawLabels();
|
||||
mPopupMenu->updateParent(LLMenuGL::sMenuContainer);
|
||||
((LLContextMenu*)mPopupMenu)->show(x, y, FALSE);
|
||||
((LLContextMenu*)mPopupMenu)->show(x, y);
|
||||
LLMenuGL::showPopup(this, mPopupMenu, x, y);
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -1550,6 +1550,12 @@ void LLViewerWindow::initWorldUI()
|
|||
|
||||
gIMMgr = LLIMMgr::getInstance();
|
||||
|
||||
// side tray
|
||||
getRootView()->addChild(LLSideTray::getInstance());
|
||||
|
||||
getRootView()->sendChildToFront(gFloaterView);
|
||||
getRootView()->sendChildToFront(gSnapshotFloaterView);
|
||||
|
||||
// new bottom panel
|
||||
gBottomTray = new LLBottomTray();
|
||||
LLRect rc = gBottomTray->getRect();
|
||||
|
|
@ -1628,13 +1634,12 @@ void LLViewerWindow::initWorldUI()
|
|||
getRootView()->addChild(gStatusBar);
|
||||
getRootView()->addChild(navbar);
|
||||
|
||||
// side tray
|
||||
getRootView()->addChild(LLSideTray::getInstance());
|
||||
|
||||
//sidetray
|
||||
//then notify area
|
||||
//then menu
|
||||
getRootView()->sendChildToFront(LLSideTray::getInstance());
|
||||
//getRootView()->sendChildToFront(LLSideTray::getInstance());
|
||||
|
||||
getRootView()->sendChildToFront(gNotifyBoxView);
|
||||
// menu holder appears on top to get first pass at all mouse events
|
||||
getRootView()->sendChildToFront(gMenuHolder);
|
||||
|
|
|
|||
Loading…
Reference in New Issue