summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.h
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2014-03-13 21:55:22 +0000
committerAura Linden <aura@lindenlab.com>2014-03-13 21:55:22 +0000
commit706ec08deb3feaea9c5c3516dea657b86b0474c3 (patch)
treea918eac8a10e43b78d156cb0620520420f0dfc62 /indra/llui/lltoolbar.h
parentd2bb4dae980a887a30b206875d8f9419901ed66a (diff)
parentcb91708332b8b8ddfe27808602ec5f43f11c24c2 (diff)
Merged in viewer-release
Diffstat (limited to 'indra/llui/lltoolbar.h')
-rwxr-xr-xindra/llui/lltoolbar.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 743951a41f..9e17eaed8b 100755
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -125,6 +125,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);
}
@@ -150,6 +163,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;
@@ -198,6 +235,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);
@@ -270,6 +308,7 @@ private:
// related widgets
LLLayoutStack* mCenteringStack;
+ LLCenterLayoutPanel* mCenterPanel;
LLPanel* mButtonPanel;
LLHandle<class LLContextMenu> mPopupMenuHandle;
LLHandle<class LLView> mRemoveButtonHandle;