Permalink
Browse files

Merge pull request #1694 from mrcarlberg/nib2cib_allow_themed_height_…

…on_checkbox_and_radio

nib2cib allows CPCheckBox and CPRadio to have themed height
  • Loading branch information...
2 parents 46022b0 + 744f3d7 commit 6673823a7439b6838f4d0522c96ee400cc6186c6 @primalmotion primalmotion committed Feb 16, 2013
Showing with 9 additions and 6 deletions.
  1. +9 −6 Tools/nib2cib/NSButton.j
@@ -213,7 +213,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.
@@ -252,11 +252,14 @@ var NSButtonIsBorderedMask = 0x00800000,
CPLog.debug("NSButton [%s]: adjusted height from %d to %d", _title == null ? "<no title>" : '"' + _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];

0 comments on commit 6673823

Please sign in to comment.