mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
fix CPTextField baseline alignement
This commit is contained in:
1 parent
5c00ea627e
commit
20c7ed0034
1 file changed
+6
-10
@@ -34,10 +34,8 @@
|
||||
|
||||
if (self)
|
||||
{
|
||||
var cell = [aCoder decodeObjectForKey:@"NSCell"];
|
||||
|
||||
if ([cell isEditable] && [[cell font] isEqual:[CPFont boldSystemFontOfSize:12.0]])
|
||||
[self setFont:[CPFont systemFontOfSize:12.0]];
|
||||
var cell = [aCoder decodeObjectForKey:@"NSCell"],
|
||||
font = [cell font];
|
||||
|
||||
[self sendActionOn:CPKeyUpMask | CPKeyDownMask];
|
||||
|
||||
@@ -64,19 +62,17 @@
|
||||
|
||||
// Only adjust the origin and size if this is a bezeled textfield.
|
||||
// This ensures that labels positioned in IB are properly positioned after nibcib.
|
||||
var frame = [self frame];
|
||||
|
||||
if ([self isBezeled])
|
||||
{
|
||||
var frame = [self frame];
|
||||
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x - 6.0, frame.origin.y - 3.0)];
|
||||
[self setFrameSize:CGSizeMake(frame.size.width + 8.0, frame.size.height + 7.0)];
|
||||
}
|
||||
else if ([[self font] isBold])
|
||||
else
|
||||
{
|
||||
var frame = [self frame];
|
||||
|
||||
[self setFrame:CGRectInset(frame, 3.0, 0.0)];
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x, frame.origin.y - 1.0)];
|
||||
[self setFrameSize:CGSizeMake(frame.size.width, frame.size.height + 2.0)];
|
||||
}
|
||||
|
||||
CPLog.debug("NSTextField: title=\"" + [self stringValue] + "\", placeholder=" + ([cell placeholderString] == null ? "<none>" : '"' + [cell placeholderString] + '"') + ", isBordered=" + [self isBordered] + ", isBezeled=" + [self isBezeled] + ", bezelStyle=" + [self bezelStyle]);
|
||||
|
||||
Reference in new issue
Block a user