mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-03 01:13:39 +00:00
fix nib2cib to correctly place normal, small and mini labels
This commit is contained in:
@@ -70,11 +70,29 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
// Adjust frame for difference between layout->bounds rect in IB
|
||||
// // Adjust frame for difference between layout->bounds rect in IB
|
||||
[self setFrame:CGRectInset(frame, 3.0, 0.0)];
|
||||
|
||||
// Hack to get baselines to align
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x, frame.origin.y - 1.0)];
|
||||
var fontSize = [[self font] size];
|
||||
|
||||
switch (fontSize)
|
||||
{
|
||||
// normal
|
||||
case 13.0:
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x, frame.origin.y - 1.0)];
|
||||
break;
|
||||
|
||||
// small
|
||||
case 11.0:
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x, frame.origin.y + 2.0)];
|
||||
break;
|
||||
|
||||
// mini
|
||||
case 9.0:
|
||||
[self setFrameOrigin:CGPointMake(frame.origin.x, frame.origin.y + 1.0)];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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