MAINT-3163 FIXED Since CHUI, floaters can be moved totally underneath bottom toolbar buttons and "lost".
parent
de9712a4ca
commit
cfcf6d9bd4
|
|
@ -2888,8 +2888,6 @@ void LLFloaterView::refresh()
|
|||
}
|
||||
}
|
||||
|
||||
const S32 FLOATER_MIN_VISIBLE_PIXELS = 16;
|
||||
|
||||
void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars/* = false*/)
|
||||
{
|
||||
if (floater->getParent() != this)
|
||||
|
|
@ -2942,11 +2940,32 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out
|
|||
}
|
||||
}
|
||||
|
||||
const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT];
|
||||
const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM];
|
||||
const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT];
|
||||
const LLRect& floater_rect = floater->getRect();
|
||||
|
||||
S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0;
|
||||
S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0;
|
||||
S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0;
|
||||
|
||||
// move window fully onscreen
|
||||
if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX ))
|
||||
{
|
||||
floater->clearSnapTarget();
|
||||
}
|
||||
else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom)
|
||||
{
|
||||
floater->translate(delta_left, 0);
|
||||
}
|
||||
else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight)
|
||||
{
|
||||
floater->translate(0, delta_bottom);
|
||||
}
|
||||
else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom)
|
||||
{
|
||||
floater->translate(delta_right, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterView::draw()
|
||||
|
|
@ -3158,6 +3177,14 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list)
|
|||
LLFloaterReg::blockShowFloaters(false);
|
||||
}
|
||||
|
||||
void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect)
|
||||
{
|
||||
if (tb < LLToolBarEnums::TOOLBAR_COUNT)
|
||||
{
|
||||
mToolbarRects[tb] = toolbar_rect;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloater::setInstanceName(const std::string& name)
|
||||
{
|
||||
if (name != mInstanceName)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#define LL_FLOATER_H
|
||||
|
||||
#include "llpanel.h"
|
||||
#include "lltoolbar.h"
|
||||
#include "lluuid.h"
|
||||
//#include "llnotificationsutil.h"
|
||||
#include <set>
|
||||
|
|
@ -518,6 +519,8 @@ private:
|
|||
// LLFloaterView
|
||||
// Parent of all floating panels
|
||||
|
||||
const S32 FLOATER_MIN_VISIBLE_PIXELS = 16;
|
||||
|
||||
class LLFloaterView : public LLUICtrl
|
||||
{
|
||||
public:
|
||||
|
|
@ -583,10 +586,13 @@ public:
|
|||
void setSnapOffsetLeft(S32 offset) { mSnapOffsetLeft = offset; }
|
||||
// </FS:KC> Fix for bad edge snapping
|
||||
|
||||
void setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect);
|
||||
|
||||
private:
|
||||
void hiddenFloaterClosed(LLFloater* floater);
|
||||
|
||||
LLRect mLastSnapRect;
|
||||
LLRect mToolbarRects[LLToolBarEnums::TOOLBAR_COUNT];
|
||||
LLHandle<LLView> mSnapView;
|
||||
BOOL mFocusCycleMode;
|
||||
S32 mSnapOffsetBottom;
|
||||
|
|
|
|||
|
|
@ -145,9 +145,10 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
|
|||
mButtonLeaveSignal(NULL),
|
||||
mButtonRemoveSignal(NULL),
|
||||
mDragAndDropTarget(false),
|
||||
// <FS:Zi> add layout style and alignment initialisation
|
||||
//mCaretIcon(NULL)
|
||||
mCaretIcon(NULL),
|
||||
// <FS:Zi> add layout style and alignment initialisation
|
||||
//mCenterPanel(NULL)
|
||||
mCenterPanel(NULL),
|
||||
mLayoutStyle(p.layout_style),
|
||||
mAlignment(p.alignment)
|
||||
// </FS:Zi>
|
||||
|
|
@ -257,14 +258,15 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
|
|||
center_panel_p.auto_resize = false;
|
||||
center_panel_p.user_resize = false;
|
||||
center_panel_p.mouse_opaque = false;
|
||||
LLLayoutPanel* center_panel = LLUICtrlFactory::create<LLLayoutPanel>(center_panel_p);
|
||||
mCenteringStack->addChild(center_panel);
|
||||
mCenterPanel = LLUICtrlFactory::create<LLCenterLayoutPanel>(center_panel_p);
|
||||
mCenteringStack->addChild(mCenterPanel);
|
||||
|
||||
LLPanel::Params button_panel_p(p.button_panel);
|
||||
button_panel_p.rect = center_panel->getLocalRect();
|
||||
button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT;
|
||||
button_panel_p.rect = mCenterPanel->getLocalRect();
|
||||
button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT;
|
||||
mButtonPanel = LLUICtrlFactory::create<LLPanel>(button_panel_p);
|
||||
center_panel->addChild(mButtonPanel);
|
||||
mCenterPanel->setButtonPanel(mButtonPanel);
|
||||
mCenterPanel->addChild(mButtonPanel);
|
||||
|
||||
// <FS:Zi> Add alignment options to toolbars
|
||||
// mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p));
|
||||
|
|
@ -1441,6 +1443,18 @@ const std::string LLToolBarButton::getToolTip() const
|
|||
return tooltip;
|
||||
}
|
||||
|
||||
void LLToolBar::LLCenterLayoutPanel::handleReshape(const LLRect& rect, bool by_user)
|
||||
{
|
||||
LLLayoutPanel::handleReshape(rect, by_user);
|
||||
|
||||
if (!mReshapeCallback.empty())
|
||||
{
|
||||
LLRect r;
|
||||
localRectToOtherView(mButtonPanel->getRect(), &r, gFloaterView);
|
||||
r.stretch(FLOATER_MIN_VISIBLE_PIXELS);
|
||||
mReshapeCallback(mLocationId, r);
|
||||
}
|
||||
}
|
||||
// <FS:Zi> Returns the current alignment for saving in XML settings
|
||||
LLToolBarEnums::Alignment LLToolBar::getAlignment() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -134,6 +134,19 @@ namespace LLToolBarEnums
|
|||
SIDE_TOP,
|
||||
};
|
||||
|
||||
enum EToolBarLocation
|
||||
{
|
||||
TOOLBAR_NONE = 0,
|
||||
TOOLBAR_LEFT,
|
||||
TOOLBAR_RIGHT,
|
||||
TOOLBAR_BOTTOM,
|
||||
|
||||
TOOLBAR_COUNT,
|
||||
|
||||
TOOLBAR_FIRST = TOOLBAR_LEFT,
|
||||
TOOLBAR_LAST = TOOLBAR_BOTTOM,
|
||||
};
|
||||
|
||||
LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType);
|
||||
|
||||
// <FS:Zi> Add alignment settings
|
||||
|
|
@ -194,6 +207,30 @@ class LLToolBar
|
|||
{
|
||||
friend class LLToolBarButton;
|
||||
public:
|
||||
|
||||
class LLCenterLayoutPanel : public LLLayoutPanel
|
||||
{
|
||||
public:
|
||||
typedef struct LLLayoutPanel::Params Params;
|
||||
typedef boost::function<void(LLToolBarEnums::EToolBarLocation tb, const LLRect& rect)> reshape_callback_t;
|
||||
|
||||
virtual ~LLCenterLayoutPanel() {}
|
||||
/*virtual*/ void handleReshape(const LLRect& rect, bool by_user);
|
||||
|
||||
void setLocationId(LLToolBarEnums::EToolBarLocation id) { mLocationId = id; }
|
||||
void setReshapeCallback(reshape_callback_t cb) { mReshapeCallback = cb; }
|
||||
void setButtonPanel(LLPanel * panel) { mButtonPanel = panel; }
|
||||
|
||||
protected:
|
||||
friend class LLUICtrlFactory;
|
||||
LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mButtonPanel(NULL) {}
|
||||
|
||||
private:
|
||||
reshape_callback_t mReshapeCallback;
|
||||
LLToolBarEnums::EToolBarLocation mLocationId;
|
||||
LLPanel * mButtonPanel;
|
||||
};
|
||||
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
Mandatory<LLToolBarEnums::ButtonType> button_display_mode;
|
||||
|
|
@ -249,6 +286,7 @@ public:
|
|||
void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
|
||||
void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; }
|
||||
bool isReadOnly() const { return mReadOnly; }
|
||||
LLCenterLayoutPanel * getCenterLayoutPanel() const { return mCenterPanel; }
|
||||
|
||||
LLToolBarButton* createButton(const LLCommandId& id);
|
||||
|
||||
|
|
@ -330,6 +368,7 @@ private:
|
|||
|
||||
// related widgets
|
||||
LLLayoutStack* mCenteringStack;
|
||||
LLCenterLayoutPanel* mCenterPanel;
|
||||
LLPanel* mButtonPanel;
|
||||
LLHandle<class LLContextMenu> mPopupMenuHandle;
|
||||
LLHandle<class LLView> mRemoveButtonHandle;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ void LLFloaterToybox::draw()
|
|||
{
|
||||
const LLCommandId& id = *it;
|
||||
|
||||
const bool command_not_present = (gToolBarView->hasCommand(id) == LLToolBarView::TOOLBAR_NONE);
|
||||
const bool command_not_present = (gToolBarView->hasCommand(id) == LLToolBarEnums::TOOLBAR_NONE);
|
||||
mToolBar->enableCommand(id, command_not_present);
|
||||
}
|
||||
|
||||
|
|
@ -175,9 +175,9 @@ void LLFloaterToybox::onToolBarButtonEnter(LLView* button)
|
|||
|
||||
switch(command_loc)
|
||||
{
|
||||
case LLToolBarView::TOOLBAR_BOTTOM: suffix = LLTrans::getString("Toolbar_Bottom_Tooltip"); break;
|
||||
case LLToolBarView::TOOLBAR_LEFT: suffix = LLTrans::getString("Toolbar_Left_Tooltip"); break;
|
||||
case LLToolBarView::TOOLBAR_RIGHT: suffix = LLTrans::getString("Toolbar_Right_Tooltip"); break;
|
||||
case LLToolBarEnums::TOOLBAR_BOTTOM: suffix = LLTrans::getString("Toolbar_Bottom_Tooltip"); break;
|
||||
case LLToolBarEnums::TOOLBAR_LEFT: suffix = LLTrans::getString("Toolbar_Left_Tooltip"); break;
|
||||
case LLToolBarEnums::TOOLBAR_RIGHT: suffix = LLTrans::getString("Toolbar_Right_Tooltip"); break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -2202,11 +2202,11 @@ LLDockControl::DocAt LLCallDialog::getDockControlPos(const std::string& toolbarB
|
|||
|
||||
switch (toolbar_loc)
|
||||
{
|
||||
case LLToolBarView::TOOLBAR_LEFT:
|
||||
case LLToolBarEnums::TOOLBAR_LEFT:
|
||||
doc_at = LLDockControl::RIGHT;
|
||||
break;
|
||||
|
||||
case LLToolBarView::TOOLBAR_RIGHT:
|
||||
case LLToolBarEnums::TOOLBAR_RIGHT:
|
||||
doc_at = LLDockControl::LEFT;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -754,14 +754,14 @@ void LLPanelStandStopFlying::updatePosition()
|
|||
//
|
||||
// S32 y_pos = 0;
|
||||
// S32 bottom_tb_center = 0;
|
||||
// if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM))
|
||||
// if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM))
|
||||
// {
|
||||
// y_pos = toolbar_bottom->getRect().getHeight();
|
||||
// bottom_tb_center = toolbar_bottom->getRect().getCenterX();
|
||||
// }
|
||||
//
|
||||
// S32 left_tb_width = 0;
|
||||
// if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT))
|
||||
// if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT))
|
||||
// {
|
||||
// left_tb_width = toolbar_left->getRect().getWidth();
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -909,21 +909,21 @@ LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
|
|||
S32 topPad=LLScriptFloaterManager::instance().getTopPad();
|
||||
|
||||
S32 bottomPad = 0;
|
||||
if (gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM)->hasButtons())
|
||||
if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->hasButtons())
|
||||
{
|
||||
bottomPad = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM)->getRect().getHeight();
|
||||
bottomPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->getRect().getHeight();
|
||||
}
|
||||
|
||||
S32 leftPad = 0;
|
||||
if (gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT)->hasButtons())
|
||||
if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons())
|
||||
{
|
||||
leftPad = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT)->getRect().getWidth();
|
||||
leftPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->getRect().getWidth();
|
||||
}
|
||||
|
||||
S32 rightPad = 0;
|
||||
if (gToolBarView->getToolbar(LLToolBarView::TOOLBAR_RIGHT)->hasButtons())
|
||||
if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT)->hasButtons())
|
||||
{
|
||||
rightPad = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_RIGHT)->getRect().getWidth();
|
||||
rightPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT)->getRect().getWidth();
|
||||
}
|
||||
|
||||
S32 width = pos.getWidth();
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
|
|||
mBottomChatStack(NULL)
|
||||
// </FS:Ansariel> Member variables needed for console chat bottom offset
|
||||
{
|
||||
for (S32 i = 0; i < TOOLBAR_COUNT; i++)
|
||||
for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; i++)
|
||||
{
|
||||
mToolbars[i] = NULL;
|
||||
}
|
||||
|
|
@ -105,12 +105,18 @@ LLToolBarView::~LLToolBarView()
|
|||
|
||||
BOOL LLToolBarView::postBuild()
|
||||
{
|
||||
mToolbars[TOOLBAR_LEFT] = getChild<LLToolBar>("toolbar_left");
|
||||
mToolbars[TOOLBAR_RIGHT] = getChild<LLToolBar>("toolbar_right");
|
||||
mToolbars[TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom");
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_LEFT] = getChild<LLToolBar>("toolbar_left");
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getCenterLayoutPanel()->setLocationId(LLToolBarEnums::TOOLBAR_LEFT);
|
||||
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_RIGHT] = getChild<LLToolBar>("toolbar_right");
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getCenterLayoutPanel()->setLocationId(LLToolBarEnums::TOOLBAR_RIGHT);
|
||||
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom");
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getCenterLayoutPanel()->setLocationId(LLToolBarEnums::TOOLBAR_BOTTOM);
|
||||
|
||||
mBottomToolbarPanel = getChild<LLView>("bottom_toolbar_panel");
|
||||
|
||||
for (int i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (int i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
mToolbars[i]->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));
|
||||
mToolbars[i]->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));
|
||||
|
|
@ -129,9 +135,9 @@ BOOL LLToolBarView::postBuild()
|
|||
|
||||
S32 LLToolBarView::hasCommand(const LLCommandId& commandId) const
|
||||
{
|
||||
S32 command_location = TOOLBAR_NONE;
|
||||
S32 command_location = LLToolBarEnums::TOOLBAR_NONE;
|
||||
|
||||
for (S32 loc = TOOLBAR_FIRST; loc <= TOOLBAR_LAST; loc++)
|
||||
for (S32 loc = LLToolBarEnums::TOOLBAR_FIRST; loc <= LLToolBarEnums::TOOLBAR_LAST; loc++)
|
||||
{
|
||||
if (mToolbars[loc]->hasCommand(commandId))
|
||||
{
|
||||
|
|
@ -143,7 +149,7 @@ S32 LLToolBarView::hasCommand(const LLCommandId& commandId) const
|
|||
return command_location;
|
||||
}
|
||||
|
||||
S32 LLToolBarView::addCommand(const LLCommandId& commandId, EToolBarLocation toolbar, int rank)
|
||||
S32 LLToolBarView::addCommand(const LLCommandId& commandId, LLToolBarEnums::EToolBarLocation toolbar, int rank)
|
||||
{
|
||||
int old_rank;
|
||||
removeCommand(commandId, old_rank);
|
||||
|
|
@ -158,7 +164,7 @@ S32 LLToolBarView::removeCommand(const LLCommandId& commandId, int& rank)
|
|||
S32 command_location = hasCommand(commandId);
|
||||
rank = LLToolBar::RANK_NONE;
|
||||
|
||||
if (command_location != TOOLBAR_NONE)
|
||||
if (command_location != LLToolBarEnums::TOOLBAR_NONE)
|
||||
{
|
||||
rank = mToolbars[command_location]->removeCommand(commandId);
|
||||
}
|
||||
|
|
@ -170,7 +176,7 @@ S32 LLToolBarView::enableCommand(const LLCommandId& commandId, bool enabled)
|
|||
{
|
||||
S32 command_location = hasCommand(commandId);
|
||||
|
||||
if (command_location != TOOLBAR_NONE)
|
||||
if (command_location != LLToolBarEnums::TOOLBAR_NONE)
|
||||
{
|
||||
mToolbars[command_location]->enableCommand(commandId, enabled);
|
||||
}
|
||||
|
|
@ -182,7 +188,7 @@ S32 LLToolBarView::stopCommandInProgress(const LLCommandId& commandId)
|
|||
{
|
||||
S32 command_location = hasCommand(commandId);
|
||||
|
||||
if (command_location != TOOLBAR_NONE)
|
||||
if (command_location != LLToolBarEnums::TOOLBAR_NONE)
|
||||
{
|
||||
mToolbars[command_location]->stopCommandInProgress(commandId);
|
||||
}
|
||||
|
|
@ -194,7 +200,7 @@ S32 LLToolBarView::flashCommand(const LLCommandId& commandId, bool flash, bool f
|
|||
{
|
||||
S32 command_location = hasCommand(commandId);
|
||||
|
||||
if (command_location != TOOLBAR_NONE)
|
||||
if (command_location != LLToolBarEnums::TOOLBAR_NONE)
|
||||
{
|
||||
mToolbars[command_location]->flashCommand(commandId, flash, force_flashing);
|
||||
}
|
||||
|
|
@ -278,7 +284,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
}
|
||||
|
||||
// Clear the toolbars now before adding the loaded commands and settings
|
||||
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
if (mToolbars[i])
|
||||
{
|
||||
|
|
@ -287,85 +293,85 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
}
|
||||
|
||||
// Add commands to each toolbar
|
||||
if (toolbar_set.left_toolbar.isProvided() && mToolbars[TOOLBAR_LEFT])
|
||||
if (toolbar_set.left_toolbar.isProvided() && mToolbars[LLToolBarEnums::TOOLBAR_LEFT])
|
||||
{
|
||||
if (toolbar_set.left_toolbar.button_display_mode.isProvided())
|
||||
{
|
||||
LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode;
|
||||
mToolbars[TOOLBAR_LEFT]->setButtonType(button_type);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setButtonType(button_type);
|
||||
}
|
||||
// <FS:Zi> Load left toolbar layout and alignment from XML
|
||||
if (toolbar_set.left_toolbar.button_alignment.isProvided())
|
||||
{
|
||||
LLToolBarEnums::Alignment alignment = toolbar_set.left_toolbar.button_alignment;
|
||||
mToolbars[TOOLBAR_LEFT]->setAlignment(alignment);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setAlignment(alignment);
|
||||
}
|
||||
|
||||
if (toolbar_set.left_toolbar.button_layout_style.isProvided())
|
||||
{
|
||||
LLToolBarEnums::LayoutStyle layout_style = toolbar_set.left_toolbar.button_layout_style;
|
||||
mToolbars[TOOLBAR_LEFT]->setLayoutStyle(layout_style);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setLayoutStyle(layout_style);
|
||||
}
|
||||
// </FS:Zi>
|
||||
BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands)
|
||||
{
|
||||
if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_LEFT]))
|
||||
if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT]))
|
||||
{
|
||||
llwarns << "Error adding command '" << command_params.name() << "' to left toolbar." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (toolbar_set.right_toolbar.isProvided() && mToolbars[TOOLBAR_RIGHT])
|
||||
if (toolbar_set.right_toolbar.isProvided() && mToolbars[LLToolBarEnums::TOOLBAR_RIGHT])
|
||||
{
|
||||
if (toolbar_set.right_toolbar.button_display_mode.isProvided())
|
||||
{
|
||||
LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode;
|
||||
mToolbars[TOOLBAR_RIGHT]->setButtonType(button_type);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setButtonType(button_type);
|
||||
}
|
||||
// <FS:Zi> Load left toolbar layout and alignment from XML
|
||||
if (toolbar_set.right_toolbar.button_alignment.isProvided())
|
||||
{
|
||||
LLToolBarEnums::Alignment alignment = toolbar_set.right_toolbar.button_alignment;
|
||||
mToolbars[TOOLBAR_RIGHT]->setAlignment(alignment);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setAlignment(alignment);
|
||||
}
|
||||
|
||||
if (toolbar_set.right_toolbar.button_layout_style.isProvided())
|
||||
{
|
||||
LLToolBarEnums::LayoutStyle layout_style = toolbar_set.right_toolbar.button_layout_style;
|
||||
mToolbars[TOOLBAR_RIGHT]->setLayoutStyle(layout_style);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setLayoutStyle(layout_style);
|
||||
}
|
||||
// </FS:Zi>
|
||||
BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands)
|
||||
{
|
||||
if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_RIGHT]))
|
||||
if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]))
|
||||
{
|
||||
llwarns << "Error adding command '" << command_params.name() << "' to right toolbar." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (toolbar_set.bottom_toolbar.isProvided() && mToolbars[TOOLBAR_BOTTOM])
|
||||
if (toolbar_set.bottom_toolbar.isProvided() && mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM])
|
||||
{
|
||||
if (toolbar_set.bottom_toolbar.button_display_mode.isProvided())
|
||||
{
|
||||
LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode;
|
||||
mToolbars[TOOLBAR_BOTTOM]->setButtonType(button_type);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setButtonType(button_type);
|
||||
}
|
||||
// <FS:Zi> Load left toolbar layout and alignment from XML
|
||||
if (toolbar_set.bottom_toolbar.button_alignment.isProvided())
|
||||
{
|
||||
LLToolBarEnums::Alignment alignment = toolbar_set.bottom_toolbar.button_alignment;
|
||||
mToolbars[TOOLBAR_BOTTOM]->setAlignment(alignment);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setAlignment(alignment);
|
||||
}
|
||||
|
||||
if (toolbar_set.bottom_toolbar.button_layout_style.isProvided())
|
||||
{
|
||||
LLToolBarEnums::LayoutStyle layout_style = toolbar_set.bottom_toolbar.button_layout_style;
|
||||
mToolbars[TOOLBAR_BOTTOM]->setLayoutStyle(layout_style);
|
||||
mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setLayoutStyle(layout_style);
|
||||
}
|
||||
// </FS:Zi>
|
||||
BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands)
|
||||
{
|
||||
if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_BOTTOM]))
|
||||
if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]))
|
||||
{
|
||||
llwarns << "Error adding command '" << command_params.name() << "' to bottom toolbar." << llendl;
|
||||
}
|
||||
|
|
@ -377,7 +383,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
|
||||
bool LLToolBarView::clearToolbars()
|
||||
{
|
||||
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
if (mToolbars[i])
|
||||
{
|
||||
|
|
@ -429,26 +435,26 @@ void LLToolBarView::saveToolbars() const
|
|||
|
||||
// Build the parameter tree from the toolbar data
|
||||
LLToolBarView::ToolbarSet toolbar_set;
|
||||
if (mToolbars[TOOLBAR_LEFT])
|
||||
if (mToolbars[LLToolBarEnums::TOOLBAR_LEFT])
|
||||
{
|
||||
toolbar_set.left_toolbar.button_display_mode = mToolbars[TOOLBAR_LEFT]->getButtonType();
|
||||
toolbar_set.left_toolbar.button_alignment = mToolbars[TOOLBAR_LEFT]->getAlignment(); // <FS_Zi>
|
||||
toolbar_set.left_toolbar.button_layout_style = mToolbars[TOOLBAR_LEFT]->getLayoutStyle(); // <FS_Zi>
|
||||
addToToolset(mToolbars[TOOLBAR_LEFT]->getCommandsList(), toolbar_set.left_toolbar);
|
||||
toolbar_set.left_toolbar.button_display_mode = mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getButtonType();
|
||||
toolbar_set.left_toolbar.button_alignment = mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getAlignment(); // <FS_Zi>
|
||||
toolbar_set.left_toolbar.button_layout_style = mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getLayoutStyle(); // <FS_Zi>
|
||||
addToToolset(mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getCommandsList(), toolbar_set.left_toolbar);
|
||||
}
|
||||
if (mToolbars[TOOLBAR_RIGHT])
|
||||
if (mToolbars[LLToolBarEnums::TOOLBAR_RIGHT])
|
||||
{
|
||||
toolbar_set.right_toolbar.button_display_mode = mToolbars[TOOLBAR_RIGHT]->getButtonType();
|
||||
toolbar_set.right_toolbar.button_alignment = mToolbars[TOOLBAR_RIGHT]->getAlignment(); // <FS_Zi>
|
||||
toolbar_set.right_toolbar.button_layout_style = mToolbars[TOOLBAR_RIGHT]->getLayoutStyle(); // <FS_Zi>
|
||||
addToToolset(mToolbars[TOOLBAR_RIGHT]->getCommandsList(), toolbar_set.right_toolbar);
|
||||
toolbar_set.right_toolbar.button_display_mode = mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getButtonType();
|
||||
toolbar_set.right_toolbar.button_alignment = mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getAlignment(); // <FS_Zi>
|
||||
toolbar_set.right_toolbar.button_layout_style = mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getLayoutStyle(); // <FS_Zi>
|
||||
addToToolset(mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getCommandsList(), toolbar_set.right_toolbar);
|
||||
}
|
||||
if (mToolbars[TOOLBAR_BOTTOM])
|
||||
if (mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM])
|
||||
{
|
||||
toolbar_set.bottom_toolbar.button_display_mode = mToolbars[TOOLBAR_BOTTOM]->getButtonType();
|
||||
toolbar_set.bottom_toolbar.button_alignment = mToolbars[TOOLBAR_BOTTOM]->getAlignment(); // <FS_Zi>
|
||||
toolbar_set.bottom_toolbar.button_layout_style = mToolbars[TOOLBAR_BOTTOM]->getLayoutStyle(); // <FS_Zi>
|
||||
addToToolset(mToolbars[TOOLBAR_BOTTOM]->getCommandsList(), toolbar_set.bottom_toolbar);
|
||||
toolbar_set.bottom_toolbar.button_display_mode = mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getButtonType();
|
||||
toolbar_set.bottom_toolbar.button_alignment = mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getAlignment(); // <FS_Zi>
|
||||
toolbar_set.bottom_toolbar.button_layout_style = mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getLayoutStyle(); // <FS_Zi>
|
||||
addToToolset(mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getCommandsList(), toolbar_set.bottom_toolbar);
|
||||
}
|
||||
|
||||
// Serialize the parameter tree
|
||||
|
|
@ -575,9 +581,9 @@ void LLToolBarView::onToolBarButtonRemoved(LLView* button)
|
|||
|
||||
void LLToolBarView::draw()
|
||||
{
|
||||
LLRect toolbar_rects[TOOLBAR_COUNT];
|
||||
LLRect toolbar_rects[LLToolBarEnums::TOOLBAR_COUNT];
|
||||
|
||||
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
if (mToolbars[i])
|
||||
{
|
||||
|
|
@ -596,7 +602,7 @@ void LLToolBarView::draw()
|
|||
}
|
||||
}
|
||||
|
||||
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
mToolbars[i]->getParent()->setVisible(mShowToolbars
|
||||
&& (mToolbars[i]->hasButtons()
|
||||
|
|
@ -608,7 +614,7 @@ void LLToolBarView::draw()
|
|||
{
|
||||
LLColor4 drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" );
|
||||
|
||||
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
gl_rect_2d(toolbar_rects[i], drop_color, TRUE);
|
||||
}
|
||||
|
|
@ -684,7 +690,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
|
|||
S32 old_toolbar_loc = gToolBarView->hasCommand(command_id);
|
||||
LLToolBar* old_toolbar = NULL;
|
||||
|
||||
if (old_toolbar_loc != TOOLBAR_NONE)
|
||||
if (old_toolbar_loc != LLToolBarEnums::TOOLBAR_NONE)
|
||||
{
|
||||
llassert(gToolBarView->mDragToolbarButton);
|
||||
old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>();
|
||||
|
|
@ -747,7 +753,7 @@ bool LLToolBarView::isModified() const
|
|||
{
|
||||
bool modified = false;
|
||||
|
||||
for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
|
||||
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
|
||||
{
|
||||
modified |= mToolbars[i]->isModified();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,19 +40,6 @@ class LLUICtrlFactory;
|
|||
class LLToolBarView : public LLUICtrl
|
||||
{
|
||||
public:
|
||||
typedef enum
|
||||
{
|
||||
TOOLBAR_NONE = 0,
|
||||
TOOLBAR_LEFT,
|
||||
TOOLBAR_RIGHT,
|
||||
TOOLBAR_BOTTOM,
|
||||
|
||||
TOOLBAR_COUNT,
|
||||
|
||||
TOOLBAR_FIRST = TOOLBAR_LEFT,
|
||||
TOOLBAR_LAST = TOOLBAR_BOTTOM,
|
||||
} EToolBarLocation;
|
||||
|
||||
// Xui structure of the toolbar panel
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> {};
|
||||
|
||||
|
|
@ -86,9 +73,9 @@ public:
|
|||
virtual void draw();
|
||||
|
||||
// Toolbar view interface with the rest of the world
|
||||
// Checks if the commandId is being used somewhere in one of the toolbars, returns EToolBarLocation
|
||||
// Checks if the commandId is being used somewhere in one of the toolbars, returns LLToolBarEnums::EToolBarLocation
|
||||
S32 hasCommand(const LLCommandId& commandId) const;
|
||||
S32 addCommand(const LLCommandId& commandId, EToolBarLocation toolbar, int rank = LLToolBar::RANK_NONE);
|
||||
S32 addCommand(const LLCommandId& commandId, LLToolBarEnums::EToolBarLocation toolbar, int rank = LLToolBar::RANK_NONE);
|
||||
S32 removeCommand(const LLCommandId& commandId, int& rank); // Sets the rank the removed command was at, RANK_NONE if not found
|
||||
S32 enableCommand(const LLCommandId& commandId, bool enabled);
|
||||
S32 stopCommandInProgress(const LLCommandId& commandId);
|
||||
|
|
@ -111,7 +98,7 @@ public:
|
|||
static void resetDragTool(LLToolBarButton* toolbarButton);
|
||||
LLInventoryObject* getDragItem();
|
||||
LLView* getBottomToolbar() { return mBottomToolbarPanel; }
|
||||
LLToolBar* getToolbar(EToolBarLocation toolbar) { return mToolbars[toolbar]; }
|
||||
LLToolBar* getToolbar(LLToolBarEnums::EToolBarLocation toolbar) { return mToolbars[toolbar]; }
|
||||
bool isModified() const;
|
||||
|
||||
// <FS:Ansariel> Getters for member variables needed for console chat bottom offset
|
||||
|
|
@ -133,7 +120,7 @@ private:
|
|||
static void onToolBarButtonRemoved(LLView* button);
|
||||
|
||||
// Pointers to the toolbars handled by the toolbar view
|
||||
LLToolBar* mToolbars[TOOLBAR_COUNT];
|
||||
LLToolBar* mToolbars[LLToolBarEnums::TOOLBAR_COUNT];
|
||||
bool mToolbarsLoaded;
|
||||
|
||||
bool mDragStarted;
|
||||
|
|
|
|||
|
|
@ -1964,6 +1964,14 @@ void LLViewerWindow::initBase()
|
|||
|
||||
// Constrain floaters to inside the menu and status bar regions.
|
||||
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
|
||||
for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; ++i)
|
||||
{
|
||||
LLToolBar * toolbarp = gToolBarView->getToolbar((LLToolBarEnums::EToolBarLocation)i);
|
||||
if (toolbarp)
|
||||
{
|
||||
toolbarp->getCenterLayoutPanel()->setReshapeCallback(boost::bind(&LLFloaterView::setToolbarRect, gFloaterView, _1, _2));
|
||||
}
|
||||
}
|
||||
gFloaterView->setFloaterSnapView(main_view->getChild<LLView>("floater_snap_region")->getHandle());
|
||||
gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View");
|
||||
|
||||
|
|
@ -5597,13 +5605,13 @@ LLRect LLViewerWindow::getChatConsoleRect()
|
|||
}// </FS:KC> Tie console to legacy snap edge when possible
|
||||
else
|
||||
{
|
||||
LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT);
|
||||
LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT);
|
||||
if (toolbar_left && toolbar_left->hasButtons())
|
||||
{
|
||||
console_rect.mLeft += toolbar_left->getRect().getWidth();
|
||||
}
|
||||
|
||||
LLToolBar* toolbar_right = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_RIGHT);
|
||||
LLToolBar* toolbar_right = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT);
|
||||
LLRect toolbar_right_screen_rect;
|
||||
toolbar_right->localRectToScreen(toolbar_right->getRect(), &toolbar_right_screen_rect);
|
||||
if (toolbar_right && toolbar_right->hasButtons() && console_rect.mRight >= toolbar_right_screen_rect.mLeft)
|
||||
|
|
|
|||
Loading…
Reference in New Issue