diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llbottomtray.cpp | 21 | ||||
| -rw-r--r-- | indra/newview/llbottomtray.h | 9 | 
2 files changed, 29 insertions, 1 deletions
| diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index dd06959472..fd711b72b0 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -696,7 +696,26 @@ bool LLBottomTray::canButtonBeShown(EResizeState processed_object_type) const  	bool can_be_shown = mResizeState & processed_object_type;  	if (can_be_shown)  	{ -		// *TODO: mantipov: synchronize with situation when button was hidden via context menu; +		static MASK MOVEMENT_PREVIOUS_BUTTONS_MASK = RS_BUTTON_GESTURES; +		static MASK CAMERA_PREVIOUS_BUTTONS_MASK = RS_BUTTON_GESTURES | RS_BUTTON_MOVEMENT; +		static MASK SNAPSHOT_PREVIOUS_BUTTONS_MASK = RS_BUTTON_GESTURES | RS_BUTTON_MOVEMENT | RS_BUTTON_CAMERA; + +		switch(processed_object_type) +		{ +		case RS_BUTTON_GESTURES: // Gestures should be shown first +			break; +		case RS_BUTTON_MOVEMENT: // Move only if gesture is shown +			can_be_shown = !(MOVEMENT_PREVIOUS_BUTTONS_MASK & mResizeState); +			break; +		case RS_BUTTON_CAMERA: +			can_be_shown = !(CAMERA_PREVIOUS_BUTTONS_MASK & mResizeState); +			break; +		case RS_BUTTON_SNAPSHOT: +			can_be_shown = !(SNAPSHOT_PREVIOUS_BUTTONS_MASK & mResizeState); +			break; +		default: // nothing to do here +			break; +		}  	}  	return can_be_shown;  } diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 86d341f233..974289d5e0 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -108,6 +108,13 @@ private:  	void log(LLView* panel, const std::string& descr);  	bool processShowButton(EResizeState shown_object_type, S32* available_width, S32* buttons_required_width);  	void processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_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(); @@ -121,6 +128,8 @@ private:  	 *  	 * 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 | 
