From 744f3d70eddb1319dc243c32cddce3770fab3485 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Thu, 29 Nov 2012 15:37:33 +0100 Subject: [PATCH] nib2cib allows CPCheckBox and CPRadio to have themed height and adjusts it correctly --- Tools/nib2cib/NSButton.j | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Tools/nib2cib/NSButton.j b/Tools/nib2cib/NSButton.j index 4b095bdce..7c2b3f26e 100644 --- a/Tools/nib2cib/NSButton.j +++ b/Tools/nib2cib/NSButton.j @@ -209,7 +209,7 @@ var NSButtonIsBorderedMask = 0x00800000, fixedHeight = YES; } - if ([cell isBordered]) + if ([cell isBordered] || [self isKindOfClass:[CPRadio class]] || [self isKindOfClass:[CPCheckBox class]]) { /* Try to figure out the intention of the theme in regards to fixed height buttons. @@ -248,11 +248,14 @@ var NSButtonIsBorderedMask = 0x00800000, CPLog.debug("NSButton [%s]: adjusted height from %d to %d", _title == null ? "" : '"' + _title + '"', oldHeight, _frame.size.height); } - // Reposition the buttons according to its particular offsets - _frame.origin.x += positionOffsetOriginX; - _frame.origin.y += positionOffsetOriginY; - _frame.size.width += positionOffsetSizeWidth; - _bounds.size.width += positionOffsetSizeWidth; + if ([cell isBordered]) + { + // Reposition the buttons according to its particular offsets + _frame.origin.x += positionOffsetOriginX; + _frame.origin.y += positionOffsetOriginY; + _frame.size.width += positionOffsetSizeWidth; + _bounds.size.width += positionOffsetSizeWidth; + } } _keyEquivalent = [cell keyEquivalent];