diff options
Diffstat (limited to 'indra/newview/llsidetray.h')
-rw-r--r-- | indra/newview/llsidetray.h | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 4c23a1920b..2516b5689f 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -40,6 +40,8 @@ class LLSideTray : public LLPanel, private LLDestroyClass<LLSideTray> { friend class LLUICtrlFactory; friend class LLDestroyClass<LLSideTray>; + friend class LLSideTrayTab; + friend class LLSideTrayButton; public: LOG_CLASS(LLSideTray); @@ -95,6 +97,8 @@ public: */ LLPanel* showPanel (const std::string& panel_name, const LLSD& params = LLSD()); + void hidePanel (const std::string& panel_name); + /** * Toggling Side Tray tab which contains "sub_panel" child of "panel_name" panel. * If "sub_panel" is not visible Side Tray is opened to display it, @@ -110,6 +114,8 @@ public: LLPanel* getActivePanel (); bool isPanelActive (const std::string& panel_name); + void setTabDocked(const std::string& tab_name, bool dock); + /* * get the panel of given type T (don't show it or do anything else with it) */ @@ -126,11 +132,6 @@ public: } /* - * get currently active tab - */ - const LLSideTrayTab* getActiveTab() const { return mActiveTab; } - - /* * collapse SideBar, hiding visible tab and moving tab buttons * to the right corner of the screen */ @@ -163,32 +164,37 @@ public: virtual BOOL postBuild(); - void onTabButtonClick(std::string name); - void onToggleCollapse(); - - bool addChild (LLView* view, S32 tab_group); - bool removeTab (LLSideTrayTab* tab); // Used to detach tabs temporarily - bool addTab (LLSideTrayTab* tab); // Used to re-attach tabs - BOOL handleMouseDown (S32 x, S32 y, MASK mask); void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); - void processTriState (); - - void updateSidetrayVisibility(); - commit_signal_t& getCollapseSignal() { return mCollapseSignal; } + /** + * @return side tray width if it's visible and expanded, 0 otherwise. + * + * Not that width of the tab buttons is not included. + * + * @see setVisibleWidthChangeCallback() + */ + S32 getVisibleWidth(); - void handleLoginComplete(); + void setVisibleWidthChangeCallback(const commit_signal_t::slot_type& cb); + + void updateSidetrayVisibility(); - LLSideTrayTab* getTab (const std::string& name); + void handleLoginComplete(); bool isTabAttached (const std::string& name); protected: + bool addChild (LLView* view, S32 tab_group); + bool removeTab (LLSideTrayTab* tab); // Used to detach tabs temporarily + bool addTab (LLSideTrayTab* tab); // Used to re-attach tabs bool hasTabs (); + const LLSideTrayTab* getActiveTab() const { return mActiveTab; } + LLSideTrayTab* getTab(const std::string& name); + void createButtons (); LLButton* createButton (const std::string& name,const std::string& image,const std::string& tooltip, @@ -196,11 +202,15 @@ protected: void arrange (); void detachTabs (); void reflectCollapseChange(); + void processTriState (); void toggleTabButton (LLSideTrayTab* tab); LLPanel* openChildPanel (LLSideTrayTab* tab, const std::string& panel_name, const LLSD& params); + void onTabButtonClick(std::string name); + void onToggleCollapse(); + private: // Implementation of LLDestroyClass<LLSideTray> static void destroyClass() @@ -209,7 +219,7 @@ private: if (LLSideTray::instanceCreated()) LLSideTray::getInstance()->setEnabled(FALSE); } - + private: LLPanel* mButtonsPanel; typedef std::map<std::string,LLButton*> button_map_t; @@ -219,7 +229,7 @@ private: tab_order_vector_t mOriginalTabOrder; LLSideTrayTab* mActiveTab; - commit_signal_t mCollapseSignal; + commit_signal_t mVisibleWidthChangeSignal; LLButton* mCollapseButton; bool mCollapsed; |