diff options
13 files changed, 72 insertions, 50 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index bd5734312a..af1f8752c9 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -125,8 +125,8 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)  	mScrollHPos( 0 ),  	mTextPadLeft(p.text_pad_left),  	mTextPadRight(p.text_pad_right), -	mMinHPixels(0),		// computed in updateTextPadding() below -	mMaxHPixels(0),		// computed in updateTextPadding() below +	mTextLeftEdge(0),		// computed in updateTextPadding() below +	mTextRightEdge(0),		// computed in updateTextPadding() below  	mCommitOnFocusLost( p.commit_on_focus_lost ),  	mRevertOnEsc( p.revert_on_esc ),  	mKeystrokeCallback( p.keystroke_callback() ), @@ -338,9 +338,8 @@ void LLLineEditor::setTextPadding(S32 left, S32 right)  void LLLineEditor::updateTextPadding()  { -	static LLUICachedControl<S32> line_editor_hpad ("UILineEditorHPad", 0); -	mMinHPixels = line_editor_hpad + llclamp(mTextPadLeft, 0, getRect().getWidth());; -	mMaxHPixels = getRect().getWidth() - mMinHPixels - llclamp(mTextPadRight, 0, getRect().getWidth()); +	mTextLeftEdge = llclamp(mTextPadLeft, 0, getRect().getWidth());; +	mTextRightEdge = getRect().getWidth() - llclamp(mTextPadRight, 0, getRect().getWidth());  } @@ -406,8 +405,8 @@ void LLLineEditor::setCursorAtLocalPos( S32 local_mouse_x )  		mScrollHPos +   		mGLFont->charFromPixelOffset(  			wtext, mScrollHPos, -			(F32)(local_mouse_x - mMinHPixels), -			(F32)(mMaxHPixels - mMinHPixels + 1)); // min-max range is inclusive +			(F32)(local_mouse_x - mTextLeftEdge), +			(F32)(mTextRightEdge - mTextLeftEdge + 1)); // min-max range is inclusive  	setCursor(cursor_pos);  } @@ -417,11 +416,11 @@ void LLLineEditor::setCursor( S32 pos )  	mCursorPos = llclamp( pos, 0, mText.length());  	S32 pixels_after_scroll = findPixelNearestPos(); -	if( pixels_after_scroll > mMaxHPixels ) +	if( pixels_after_scroll > mTextRightEdge )  	{  		S32 width_chars_to_left = mGLFont->getWidth(mText.getWString().c_str(), 0, mScrollHPos); -		S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mMaxHPixels - mMinHPixels + width_chars_to_left)));  -		S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mMaxHPixels - mMinHPixels), mText.length(), getCursor()); +		S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mTextRightEdge - mTextLeftEdge + width_chars_to_left)));  +		S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), getCursor());  		if (old_cursor_pos == last_visible_char)  		{  			mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD)); @@ -682,17 +681,17 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)  			S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);  			mScrollTimer.reset();  			mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME); -			if( (x < mMinHPixels) && (mScrollHPos > 0 ) ) +			if( (x < mTextLeftEdge) && (mScrollHPos > 0 ) )  			{  				// Scroll to the left  				mScrollHPos = llclamp(mScrollHPos - increment, 0, mText.length());  			}  			else -			if( (x > mMaxHPixels) && (mCursorPos < (S32)mText.length()) ) +			if( (x > mTextRightEdge) && (mCursorPos < (S32)mText.length()) )  			{  				// If scrolling one pixel would make a difference...  				S32 pixels_after_scrolling_one_char = findPixelNearestPos(1); -				if( pixels_after_scrolling_one_char >= mMaxHPixels ) +				if( pixels_after_scrolling_one_char >= mTextRightEdge )  				{  					// ...scroll to the right  					mScrollHPos = llclamp(mScrollHPos + increment, 0, mText.length()); @@ -1671,7 +1670,7 @@ void LLLineEditor::draw()  	}  	S32 rendered_text = 0; -	F32 rendered_pixels_right = (F32)mMinHPixels; +	F32 rendered_pixels_right = (F32)mTextLeftEdge;  	F32 text_bottom = (F32)background.mBottom + (F32)lineeditor_v_pad;  	if( (gFocusMgr.getKeyboardFocus() == this) && hasSelection() ) @@ -1700,17 +1699,17 @@ void LLLineEditor::draw()  				0,  				LLFontGL::NO_SHADOW,  				select_left - mScrollHPos, -				mMaxHPixels - llround(rendered_pixels_right), +				mTextRightEdge - llround(rendered_pixels_right),  				&rendered_pixels_right);  		} -		if( (rendered_pixels_right < (F32)mMaxHPixels) && (rendered_text < text_len) ) +		if( (rendered_pixels_right < (F32)mTextRightEdge) && (rendered_text < text_len) )  		{  			LLColor4 color = mHighlightColor;  			color.setAlpha(alpha);  			// selected middle  			S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text); -			width = llmin(width, mMaxHPixels - llround(rendered_pixels_right)); +			width = llmin(width, mTextRightEdge - llround(rendered_pixels_right));  			gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color);  			LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ); @@ -1722,11 +1721,11 @@ void LLLineEditor::draw()  				0,  				LLFontGL::NO_SHADOW,  				select_right - mScrollHPos - rendered_text, -				mMaxHPixels - llround(rendered_pixels_right), +				mTextRightEdge - llround(rendered_pixels_right),  				&rendered_pixels_right);  		} -		if( (rendered_pixels_right < (F32)mMaxHPixels) && (rendered_text < text_len) ) +		if( (rendered_pixels_right < (F32)mTextRightEdge) && (rendered_text < text_len) )  		{  			// unselected, right side  			mGLFont->render(  @@ -1737,7 +1736,7 @@ void LLLineEditor::draw()  				0,  				LLFontGL::NO_SHADOW,  				S32_MAX, -				mMaxHPixels - llround(rendered_pixels_right), +				mTextRightEdge - llround(rendered_pixels_right),  				&rendered_pixels_right);  		}  	} @@ -1751,7 +1750,7 @@ void LLLineEditor::draw()  			0,  			LLFontGL::NO_SHADOW,  			S32_MAX, -			mMaxHPixels - llround(rendered_pixels_right), +			mTextRightEdge - llround(rendered_pixels_right),  			&rendered_pixels_right);  	}  #if 1 // for when we're ready for image art. @@ -1809,14 +1808,14 @@ void LLLineEditor::draw()  		if (0 == mText.length() && mReadOnly)  		{  			mGLFont->render(mLabel.getWString(), 0, -							mMinHPixels, (F32)text_bottom, +							mTextLeftEdge, (F32)text_bottom,  							label_color,  							LLFontGL::LEFT,  							LLFontGL::BOTTOM,  							0,  							LLFontGL::NO_SHADOW,  							S32_MAX, -							mMaxHPixels - llround(rendered_pixels_right), +							mTextRightEdge - llround(rendered_pixels_right),  							&rendered_pixels_right, FALSE);  		} @@ -1834,14 +1833,14 @@ void LLLineEditor::draw()  		if (0 == mText.length())  		{  			mGLFont->render(mLabel.getWString(), 0, -							mMinHPixels, (F32)text_bottom, +							mTextLeftEdge, (F32)text_bottom,  							label_color,  							LLFontGL::LEFT,  							LLFontGL::BOTTOM,  							0,  							LLFontGL::NO_SHADOW,  							S32_MAX, -							mMaxHPixels - llround(rendered_pixels_right), +							mTextRightEdge - llround(rendered_pixels_right),  							&rendered_pixels_right, FALSE);  		}  		// Draw children (border) @@ -1859,7 +1858,7 @@ void LLLineEditor::draw()  S32 LLLineEditor::findPixelNearestPos(const S32 cursor_offset) const  {  	S32 dpos = getCursor() - mScrollHPos + cursor_offset; -	S32 result = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos, dpos) + mMinHPixels; +	S32 result = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos, dpos) + mTextLeftEdge;  	return result;  } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 4c4b00094d..b96220e020 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -303,8 +303,8 @@ protected:  	LLFrameTimer mScrollTimer;  	S32			mTextPadLeft;				// Used to reserve space before the beginning of the text for children.  	S32			mTextPadRight;				// Used to reserve space after the end of the text for children. -	S32			mMinHPixels; -	S32			mMaxHPixels; +	S32			mTextLeftEdge;				// Pixels, cached left edge of text based on left padding and width +	S32			mTextRightEdge;				// Pixels, cached right edge of text based on right padding and width  	BOOL		mCommitOnFocusLost;  	BOOL		mRevertOnEsc; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 075aee46c7..b0f782622c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9251,17 +9251,6 @@        <key>Value</key>        <integer>2</integer>      </map> -    <key>UILineEditorHPad</key> -    <map> -      <key>Comment</key> -      <string>UI Line Editor Horizontal Pad</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>S32</string> -      <key>Value</key> -      <integer>2</integer> -    </map>      <key>UILineEditorVPad</key>      <map>        <key>Comment</key> diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 6b28edf0b6..a57aea5734 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -158,6 +158,7 @@ LLLocationInputCtrl::Params::Params()  	add_landmark_image_disabled("add_landmark_image_disabled"),  	add_landmark_image_hover("add_landmark_image_hover"),  	add_landmark_image_selected("add_landmark_image_selected"), +	add_landmark_hpad("add_landmark_hpad", 0),  	icon_hpad("icon_hpad", 0),  	add_landmark_button("add_landmark_button"),  	info_button("info_button"), @@ -174,6 +175,7 @@ LLLocationInputCtrl::Params::Params()  LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)  :	LLComboBox(p),  	mIconHPad(p.icon_hpad), +	mAddLandmarkHPad(p.add_landmark_hpad),  	mInfoBtn(NULL),  	mLocationContextMenu(NULL),  	mAddLandmarkBtn(NULL), @@ -608,7 +610,7 @@ void LLLocationInputCtrl::refreshLocation()  void LLLocationInputCtrl::refreshParcelIcons()  {  	// Our "cursor" moving right to left -	S32 x = mAddLandmarkBtn->getRect().mLeft - mIconHPad; +	S32 x = mAddLandmarkBtn->getRect().mLeft - mAddLandmarkHPad;  	static LLUICachedControl<bool> show_properties("NavBarShowParcelProperties", false);  	if (show_properties) diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 3bd23e80a9..608176290e 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -65,7 +65,8 @@ public:  											add_landmark_image_disabled,  											add_landmark_image_hover,  											add_landmark_image_selected; -		Optional<S32>						icon_hpad; +		Optional<S32>						icon_hpad, +											add_landmark_hpad;  		Optional<LLButton::Params>			add_landmark_button,  											info_button;  		Optional<LLIconCtrl::Params>		voice_icon, @@ -139,7 +140,8 @@ private:  	LLMenuGL*				mLocationContextMenu;  	LLButton*				mAddLandmarkBtn;  	LLButton*				mInfoBtn; -	S32						mIconHPad; +	S32						mIconHPad;			// pad between all icons +	S32						mAddLandmarkHPad;	// pad to left of landmark star  	enum EParcelIcon  	{ diff --git a/indra/newview/skins/default/xui/en/alert_line_editor.xml b/indra/newview/skins/default/xui/en/alert_line_editor.xml index ab708adb06..97991153d8 100644 --- a/indra/newview/skins/default/xui/en/alert_line_editor.xml +++ b/indra/newview/skins/default/xui/en/alert_line_editor.xml @@ -7,5 +7,5 @@    ignore_tab="true"    max_length="254"    text_pad_right="0" -  text_pad_left="0" +  text_pad_left="2"    mouse_opaque="true"/> diff --git a/indra/newview/skins/default/xui/en/floater_test_line_editor.xml b/indra/newview/skins/default/xui/en/floater_test_line_editor.xml index 0531b52e5a..fe6ec91709 100644 --- a/indra/newview/skins/default/xui/en/floater_test_line_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_test_line_editor.xml @@ -2,7 +2,7 @@  <floater   legacy_header_height="18"   can_resize="true" - height="400" + height="500"   layout="topleft"   name="floater_test_line_editor"   help_topic="floater_test_line_editor" @@ -62,6 +62,34 @@     width="200">      Disabled red-text line editor    </line_editor> +  <line_editor +   height="20" +   left_delta="0" +   name="left_pad_editor" +   text_pad_left="25" +   top_pad="10" +   width="200"> +    25 px left text padding +  </line_editor> +  <line_editor +   height="20" +   left_delta="0" +   name="left_pad_editor" +   text_pad_right="75" +   top_pad="10" +   width="200"> +    75 px right text padding +  </line_editor> +  <line_editor +   height="20" +   left_delta="0" +   name="left_pad_editor" +   text_pad_left="25" +   text_pad_right="75" +   top_pad="10" +   width="200"> +    25 px left 75 px right text padding +  </line_editor>    <!-- "search_editor" is a specialized line_editor that shows read-only         help text until the user clicks in the widget. -->    <search_editor diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index a4149c174f..37d59de66f 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -14,7 +14,7 @@          Things      </panel.string>      <filter_editor -     text_pad_left="12" +     text_pad_left="14"       follows="left|top|right"  	 font="SanSerif"       height="20" diff --git a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml index ec8395a7c5..0e34243349 100644 --- a/indra/newview/skins/default/xui/en/widgets/filter_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/filter_editor.xml @@ -2,7 +2,7 @@  <filter_editor    clear_button_visible="true"    search_button_visible="true" -  text_pad_left="5" +  text_pad_left="7"    select_on_focus="true"    background_image="TextField_Search_Off"    background_image_disabled="TextField_Search_Disabled" diff --git a/indra/newview/skins/default/xui/en/widgets/line_editor.xml b/indra/newview/skins/default/xui/en/widgets/line_editor.xml index 546fbd9b47..a21e3f2645 100644 --- a/indra/newview/skins/default/xui/en/widgets/line_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/line_editor.xml @@ -8,6 +8,7 @@               ignore_tab="true"               cursor_color="TextCursorColor"               text_color="TextFgColor" +			 text_pad_left="2"               text_readonly_color="TextFgReadOnlyColor"               text_tentative_color="TextFgTentativeColor"  			 highlight_color="EmphasisColor" diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 17b1479ec4..5984634e4c 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -11,6 +11,7 @@                  add_landmark_image_disabled="Favorite_Star_Off"                  add_landmark_image_hover="Favorite_Star_Over"                  add_landmark_image_selected="Favorite_Star_Press" +				add_landmark_hpad="8"                  icon_hpad="2"                  allow_text_entry="true"                  list_position="below" @@ -84,7 +85,7 @@    <!-- Default text color is invisible on top of nav bar background -->    <damage_text      name="damage_text" -	width="50" +	width="35"  	height="18"  	top="16"  	halign="right" @@ -98,7 +99,7 @@    <combo_list bg_writeable_color="MenuDefaultBgColor" page_lines="10"                scroll_bar_bg_visible="true" />    <combo_editor name="Combo Text Entry" -                text_pad_left="20" +                text_pad_left="22"                  select_on_focus="false"                  font="SansSerifSmall"                  bevel_style="none" diff --git a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml index 56204201ef..c2a70d4b39 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml @@ -13,7 +13,7 @@   <combo_editor    name="child1"    select_on_focus="true" -  text_pad_left="28"  +  text_pad_left="30"     background_image="TextField_Search_Off"    background_image_disabled="TextField_Search_Disabled"    background_image_focused="TextField_Search_Active"/> diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml index 9a79243b03..f644a710b2 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -2,7 +2,7 @@  <search_editor    clear_button_visible="false"    search_button_visible="true" -  text_pad_left="4"  +  text_pad_left="6"     select_on_focus="true"    background_image="TextField_Search_Off"    background_image_disabled="TextField_Search_Disabled"  | 
