diff options
Diffstat (limited to 'indra/newview/llbottomtray.h')
-rw-r--r-- | indra/newview/llbottomtray.h | 66 |
1 files changed, 58 insertions, 8 deletions
diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 3847168ae1..7640cdcf9d 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -98,25 +98,74 @@ private: , RS_BUTTON_MOVEMENT = 0x0010 , RS_BUTTON_GESTURES = 0x0020 , RS_BUTTON_SPEAK = 0x0040 - , RS_RESIZABLE_BUTTONS = /*RS_BUTTON_SNAPSHOT | */RS_BUTTON_CAMERA | RS_BUTTON_MOVEMENT | RS_BUTTON_GESTURES + + /** + * Specifies buttons which can be hidden when bottom tray is shrunk. + * They are: Gestures, Movement (Move), Camera (View), Snapshot + */ + , RS_BUTTONS_CAN_BE_HIDDEN = RS_BUTTON_SNAPSHOT | RS_BUTTON_CAMERA | RS_BUTTON_MOVEMENT | RS_BUTTON_GESTURES }EResizeState; - void updateResizeState(S32 new_width, S32 cur_width); - void verifyChildControlsSizes(); - void processWidthDecreased(S32 delta_width); + S32 processWidthDecreased(S32 delta_width); void processWidthIncreased(S32 delta_width); void log(LLView* panel, const std::string& descr); - bool processShowButton(EResizeState shown_object_type, S32* available_width, S32* buttons_required_width); - void processHideButton(EResizeState shown_object_type, S32* required_width, S32* buttons_freed_width); - bool canButtonBeShown(LLPanel* panel) const; + bool processShowButton(EResizeState shown_object_type, S32* available_width); + void processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width); + + /** + * Shrinks shown buttons to reduce total taken space. + * + * @param - required_width - width which buttons can use to be shrunk. It is a negative value. + * It is increased on the value processed by buttons. + */ + void processShrinkButtons(S32* required_width, S32* buttons_freed_width); + void processShrinkButton(EResizeState processed_object_type, S32* required_width); + + /** + * Extends shown buttons to increase total taken space. + * + * @param - available_width - width which buttons can use to be extended. It is a positive value. + * It is decreased on the value processed by buttons. + */ + void processExtendButtons(S32* available_width); + void processExtendButton(EResizeState processed_object_type, S32* available_width); + + /** + * Determines if specified by type object can be shown. It should be hidden by shrink before. + * + * Processes buttons a such way to show buttons in constant order: + * - Gestures, Move, View, Snapshot + */ + bool canButtonBeShown(EResizeState processed_object_type) const; void initStateProcessedObjectMap(); - void showTrayButton(EResizeState shown_object_type, bool visible); + + /** + * Sets passed visibility to object specified by resize type. + */ + void setTrayButtonVisible(EResizeState shown_object_type, bool visible); + + /** + * Sets passed visibility to object specified by resize type if it is possible. + * + * If it is impossible to show required button due to there is no enough room in bottom tray + * it will no be shown. Is called via context menu commands. + * In this case Alert Dialog will be shown to notify user about that. + * + * Method also stores resize state to be processed while future bottom tray extending: + * - if hidden while resizing button should be hidden it will not be shown while extending; + * - if hidden via context menu button should be shown but there is no enough room for now + * it will be shown while extending. + */ + void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible); MASK mResizeState; typedef std::map<EResizeState, LLPanel*> state_object_map_t; state_object_map_t mStateProcessedObjectMap; + typedef std::map<EResizeState, S32> state_object_width_map_t; + state_object_width_map_t mObjectDefaultWidthMap; + protected: LLBottomTray(const LLSD& key = LLSD()); @@ -132,6 +181,7 @@ protected: LLChicletPanel* mChicletPanel; LLNotificationChiclet* mSysWell; + LLPanel* mSpeakPanel; LLSpeakButton* mSpeakBtn; LLNearbyChatBar* mNearbyChatBar; LLLayoutStack* mToolbarStack; |