update origin Y according to control Size

This commit is contained in:
Christophe Serafin committed 2014-08-07 18:27:01 -07:00
1 parent 568a652fb4
commit c8a04b998b
4 files changed
+67 -15

No files matched your search

+12
View File
@@ -252,6 +252,18 @@ var NSButtonIsBorderedMask = 0x00800000,
_frame.origin.y += positionOffsetOriginY;
_frame.size.width += positionOffsetSizeWidth;
_bounds.size.width += positionOffsetSizeWidth;
// Convert Cocoa sizes to Cappuccino sizes.
switch([cell controlSize])
{
case CPSmallControlSize:
self._frame.origin.y -= 4;
break;
case CPMiniControlSize:
self._frame.origin.y -= 12;
break;
}
}
}
+12 -6
View File
@@ -92,13 +92,19 @@ var NSDatePickerDefaultSize = 22,
_bounds.size.width = MAX(_frame.size.width, minSize.width);
}
if (_datePickerStyle == CPTextFieldAndStepperDatePickerStyle)
{
_frame.size.width -= 3;
_bounds.size.width -= 3;
}
_frame.origin.y -= _frame.size.height - NSDatePickerDefaultSize - 4;
// Convert Cocoa sizes to Cappuccino sizes.
switch([cell controlSize])
{
case CPSmallControlSize:
self._frame.origin.y -= 3;
break;
case CPMiniControlSize:
self._frame.origin.y -= 6;
break;
}
}
else
{
+23 -5
View File
@@ -41,11 +41,29 @@
[self setPullsDown:[cell pullsDown]];
_preferredEdge = [cell preferredEdge];
// adjust the frame
_frame.origin.x -= 4;
_frame.origin.y -= 4;
_frame.size.width += 7;
_bounds.size.width += 7;
// Convert Cocoa sizes to Cappuccino sizes.
switch([cell controlSize])
{
case CPSmallControlSize:
self._frame.origin.y -= 7;
self._frame.size.width += 10;
self._bounds.size.width += 10;
break;
case CPMiniControlSize:
self._frame.origin.y -= 4;
self._frame.size.width += 5;
self._bounds.size.width += 5;
break;
default:
case CPRegularControlSize:
self._frame.origin.x -= 4;
self._frame.origin.y -= 4;
self._frame.size.width += 10;
self._bounds.size.width += 10;
break;
}
}
@end
+20 -4
View File
@@ -43,10 +43,26 @@
self._autorepeat = [cell autorepeat];
self._objectValue = [cell objectValue];
// Convert Cocoa normal size to Cappuccino normal size.
self._frame.origin.y += 2;
self._frame.size.height -= 2;
self._bounds.size.height -= 2;
// Convert Cocoa sizes to Cappuccino sizes.
switch([cell controlSize])
{
case CPSmallControlSize:
self._frame.origin.y += 8;
self._frame.origin.x += 4;
break;
case CPMiniControlSize:
self._frame.origin.x += 4;
break;
default:
case CPRegularControlSize:
self._frame.origin.y += 12;
self._frame.origin.x += 4;
self._frame.size.height -= 2;
self._bounds.size.height -= 2;
break;
}
}
@end