diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llbutton.cpp | 14 | ||||
| -rw-r--r-- | indra/llui/llbutton.h | 18 | ||||
| -rw-r--r-- | indra/llui/lltabcontainer.cpp | 14 | ||||
| -rw-r--r-- | indra/llui/lltabcontainer.h | 11 | 
4 files changed, 33 insertions, 24 deletions
| diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 14b77925f2..1d4dc35cee 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -81,10 +81,9 @@ LLButton::Params::Params()  	image_pressed_selected("image_pressed_selected"),  	image_overlay("image_overlay"),  	image_overlay_alignment("image_overlay_alignment", std::string("center")), -	image_left_pad("image_left_pad"), -	image_right_pad("image_right_pad"),  	image_top_pad("image_top_pad"),  	image_bottom_pad("image_bottom_pad"), +	imgoverlay_label_space("imgoverlay_label_space", 1),  	label_color("label_color"),  	label_color_selected("label_color_selected"),	// requires is_toggle true  	label_color_disabled("label_color_disabled"), @@ -144,10 +143,9 @@ LLButton::LLButton(const LLButton::Params& p)  	mImageOverlay(p.image_overlay()),  	mImageOverlayColor(p.image_overlay_color()),  	mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), -	mImageOverlayLeftPad(p.image_left_pad), -	mImageOverlayRightPad(p.image_right_pad),  	mImageOverlayTopPad(p.image_top_pad),  	mImageOverlayBottomPad(p.image_bottom_pad), +	mImgOverlayLabelSpace(p.imgoverlay_label_space),  	mIsToggle(p.is_toggle),  	mScaleImage(p.scale_image),  	mDropShadowedText(p.label_shadow), @@ -783,9 +781,9 @@ void LLButton::draw()  		switch(mImageOverlayAlignment)  		{  		case LLFontGL::LEFT: -			text_left += overlay_width + 1; +			text_left += overlay_width + mImgOverlayLabelSpace;  			mImageOverlay->draw( -				mImageOverlayLeftPad, +				mLeftHPad,  				center_y - (overlay_height / 2),   				overlay_width,   				overlay_height,  @@ -800,9 +798,9 @@ void LLButton::draw()  				overlay_color);  			break;  		case LLFontGL::RIGHT: -			text_right -= overlay_width + 1; +			text_right -= overlay_width + mImgOverlayLabelSpace;  			mImageOverlay->draw( -				getRect().getWidth() - mImageOverlayRightPad - overlay_width, +				getRect().getWidth() - mRightHPad - overlay_width,  				center_y - (overlay_height / 2),   				overlay_width,   				overlay_height,  diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 8e5f19602f..8f35db1007 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -107,11 +107,14 @@ public:  		Optional<S32>			pad_bottom; // under text label  		//image overlay paddings -		Optional<S32>			image_left_pad; -		Optional<S32>			image_right_pad;  		Optional<S32>			image_top_pad;  		Optional<S32>			image_bottom_pad; +		/** +		 * Space between image_overlay and label +		 */ +		Optional<S32>			imgoverlay_label_space; +  		// callbacks  		Optional<CommitCallbackParam>	click_callback, // alias -> commit_callback  										mouse_down_callback, @@ -192,10 +195,6 @@ public:  	void			setLeftHPad( S32 pad )					{ mLeftHPad = pad; }  	void			setRightHPad( S32 pad )					{ mRightHPad = pad; } -	void 			setImageOverlayLeftPad( S32 pad )			{ mImageOverlayLeftPad = pad; } -	S32 			getImageOverlayLeftPad() const				{ return mImageOverlayLeftPad; } -	void 			setImageOverlayRightPad( S32 pad )			{ mImageOverlayRightPad = pad; } -	S32 			getImageOverlayRightPad() const				{ return mImageOverlayRightPad; }  	void 			setImageOverlayTopPad( S32 pad )			{ mImageOverlayTopPad = pad; }  	S32 			getImageOverlayTopPad() const				{ return mImageOverlayTopPad; }  	void 			setImageOverlayBottomPad( S32 pad )			{ mImageOverlayBottomPad = pad; } @@ -328,11 +327,14 @@ private:  	S32							mRightHPad;  	S32							mBottomVPad;	// under text label -	S32							mImageOverlayLeftPad; -	S32							mImageOverlayRightPad;  	S32							mImageOverlayTopPad;  	S32							mImageOverlayBottomPad; +	/* +	 * Space between image_overlay and label +	 */ +	S32							mImgOverlayLabelSpace; +  	F32							mHoverGlowStrength;  	F32							mCurGlowStrength; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 19408989a5..2ec56d6089 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -212,7 +212,8 @@ LLTabContainer::Params::Params()  	middle_tab("middle_tab"),  	last_tab("last_tab"),  	use_custom_icon_ctrl("use_custom_icon_ctrl", false), -	tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0) +	tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), +	use_ellipses("use_ellipses")  {  	name(std::string("tab_container"));  	mouse_opaque = false; @@ -249,7 +250,8 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)  	mMiddleTabParams(p.middle_tab),  	mLastTabParams(p.last_tab),  	mCustomIconCtrlUsed(p.use_custom_icon_ctrl), -	mTabIconCtrlPad(p.tab_icon_ctrl_pad) +	mTabIconCtrlPad(p.tab_icon_ctrl_pad), +	mUseTabEllipses(p.use_ellipses)  {  	static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); @@ -1485,8 +1487,8 @@ BOOL LLTabContainer::setTab(S32 which)  		{  			LLTabTuple* tuple = *iter;  			BOOL is_selected = ( tuple == selected_tuple ); -			tuple->mButton->setUseEllipses(TRUE); -			tuple->mButton->setHAlign(LLFontGL::LEFT); +			tuple->mButton->setUseEllipses(mUseTabEllipses); +			tuple->mButton->setHAlign(mFontHalign);  			tuple->mTabPanel->setVisible( is_selected );  // 			tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here.  			tuple->mButton->setToggleState( is_selected ); @@ -1628,15 +1630,11 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon)  void LLTabContainer::reshapeTuple(LLTabTuple* tuple)  {  	static LLUICachedControl<S32> tab_padding ("UITabPadding", 0); -	static LLUICachedControl<S32> image_left_padding ("UIButtonImageLeftPadding", 4); -	static LLUICachedControl<S32> image_right_padding ("UIButtonImageRightPadding", 4);  	static LLUICachedControl<S32> image_top_padding ("UIButtonImageTopPadding", 2);  	static LLUICachedControl<S32> image_bottom_padding ("UIButtonImageBottomPadding", 2);  	if (!mIsVertical)  	{ -		tuple->mButton->setImageOverlayLeftPad(image_left_padding); -		tuple->mButton->setImageOverlayRightPad(image_right_padding);  		tuple->mButton->setImageOverlayTopPad(image_top_padding);  		tuple->mButton->setImageOverlayBottomPad(image_bottom_padding); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 4b5d45fb73..50ec2679f6 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -93,6 +93,16 @@ public:  											last_tab;  		/** +		 * Tab label horizontal alignment +		 */ +		Optional<LLFontGL::HAlign>			font_halign; + +		/** +		 * Tab label ellipses +		 */ +		Optional<bool>						use_ellipses; + +		/**  		 * Use LLCustomButtonIconCtrl or LLButton in LLTabTuple  		 */  		Optional<bool>						use_custom_icon_ctrl; @@ -294,6 +304,7 @@ private:  	bool							mCustomIconCtrlUsed;  	S32								mTabIconCtrlPad; +	bool							mUseTabEllipses;  };  #endif  // LL_TABCONTAINER_H | 
