Skip to content

Commit

Permalink
solve the problem reported by Ross here :
Browse files Browse the repository at this point in the history
  • Loading branch information
tbalthazar authored and Ross Boucher committed Jan 16, 2009
1 parent 03f1cf8 commit c2ed5b6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions AppKit/CPTextField.j
Expand Up @@ -176,6 +176,7 @@ var _CPTextFieldSquareBezelColor = nil,
_DOMTextElement.style.whiteSpace = "pre";
_DOMTextElement.style.cursor = "default";
_DOMTextElement.style.zIndex = 100;
_DOMTextElement.style.overflow = "hidden";

_DOMElement.appendChild(_DOMTextElement);
#endif
Expand Down Expand Up @@ -401,13 +402,22 @@ var _CPTextFieldSquareBezelColor = nil,
element.style.color = _DOMElement.style.color;
element.style.font = _DOMElement.style.font;
element.style.zIndex = 1000;
element.style.width = CGRectGetWidth([self bounds]) - 3.0 + "px";
element.style.marginTop = "0px";
if (_isBezeled && _bezelStyle == CPTextFieldRoundedBezel)
element.style.paddingLeft = ROUNDEDBEZEL_HORIZONTAL_PADDING - 1.0 + "px";

//element.style.left = _DOMTextElement.style.left;
//element.style.top = _DOMTextElement.style.top;
{
// http://cappuccino.lighthouseapp.com/projects/16499/tickets/191-cptextfield-shifts-updown-when-receiveslosts-focus
// uncommenting the following 2 lines will solve the problem in Firefox only ...
// element.style.paddingTop = TOP_PADDING - 0.0 + "px" ;
// element.style.paddingLeft = HORIZONTAL_PADDING - 3.0 + "px" ;

element.style.top = "0px" ;
element.style.left = ROUNDEDBEZEL_HORIZONTAL_PADDING + 1.0 + "px" ;
element.style.width = CGRectGetWidth([self bounds]) - (2 * ROUNDEDBEZEL_HORIZONTAL_PADDING) + "px";
}
else
{
element.style.width = CGRectGetWidth([self bounds]) - 3.0 + "px";
}

_DOMElement.appendChild(element);
window.setTimeout(function() { element.focus(); }, 0.0);
Expand Down

0 comments on commit c2ed5b6

Please sign in to comment.