Fixes "Enter name of number" text being cut in the search field.

cusax-fix
Yana Stamcheva 13 years ago
parent 2cfb06bf36
commit 9378c38d9a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 743 B

@ -127,7 +127,7 @@ protected void customPaintBackground(Graphics g)
int dy = (c.getY() + c.getHeight()) / 2 int dy = (c.getY() + c.getHeight()) / 2
- searchIcon.getIconHeight()/2; - searchIcon.getIconHeight()/2;
g2.drawImage(searchIcon.getImage(), 5, dy + 1, null); g2.drawImage(searchIcon.getImage(), 3, dy + 1, null);
if (c.getText() != null if (c.getText() != null
&& c.getText().length() > 0 && c.getText().length() > 0
@ -171,11 +171,11 @@ protected Rectangle getVisibleEditorRect()
if ((rect.width > 0) && (rect.height > 0)) if ((rect.width > 0) && (rect.height > 0))
{ {
rect.x += searchIcon.getIconWidth() + 8; rect.x += searchIcon.getIconWidth() + 5;
rect.width -= searchIcon.getIconWidth() + 8; rect.width -= (searchIcon.getIconWidth() + 5);
if (isCallButtonEnabled) if (isCallIconVisible)
rect.width -= callRolloverIcon.getWidth(null) + 12; rect.width -= (callRolloverIcon.getWidth(null) + 12);
else else
rect.width -= 8; rect.width -= 8;

@ -160,6 +160,7 @@ private void setDefaultText()
{ {
super.setText(defaultText); super.setText(defaultText);
this.setForeground(defaultTextColor); this.setForeground(defaultTextColor);
this.setCaretPosition(0);
} }
/** /**

@ -307,7 +307,7 @@ protected Rectangle getDeleteButtonRect()
*/ */
protected Rectangle getVisibleEditorRect() protected Rectangle getVisibleEditorRect()
{ {
if (!isDeleteButtonEnabled) if (!isDeleteIconVisible)
{ {
return super.getVisibleEditorRect(); return super.getVisibleEditorRect();
} }

Loading…
Cancel
Save