Sizing code had been added to CPTextField initWithCoder that required resizing in NSTextField NS_initWithCoder to be removed. However, the sizing code was removed, so this code has to be re-inserted.

This commit is contained in:
Aparajita Fishman
2010-11-16 10:29:19 -05:00
committed by Randall Luecke
parent c8afcde4e5
commit ace66b2b2f
+9 -4
View File
@@ -58,14 +58,19 @@
var textColor = [cell textColor],
defaultColor = [self currentValueForThemeAttribute:@"text-color"];
// Don't change the text color if it is not the default, that messes up the theme lookups later
// Don't change the text color if it is not the default, that messes up the theme lookups later
if (![textColor isEqual:defaultColor])
[self setTextColor:[cell textColor]];
var frame = [self frame];
// Only adjust the origin and size if this is a bezeled textfield.
// This ensures that labels positioned in IB are properly positioned after nibcib.
if ([self isBezeled])
{
var frame = [self frame];
[self setFrameOrigin:CGPointMake(frame.origin.x, frame.origin.y)];
[self setFrameSize:CGSizeMake(frame.size.width, frame.size.height)];
[self setFrameOrigin:CGPointMake(frame.origin.x - 4.0, frame.origin.y - 4.0)];
[self setFrameSize:CGSizeMake(frame.size.width + 8.0, frame.size.height + 8.0)];
}
CPLog.debug([self stringValue] + " => isBordered=" + [self isBordered] + ", isBezeled=" + [self isBezeled] + ", bezelStyle=" + [self bezelStyle] + "("+[cell stringValue]+", " + [cell placeholderString] + ")");
}