Skip to content
This repository
Browse code

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...
commit 6673823a7439b6838f4d0522c96ee400cc6186c6 2 parents 46022b0 + 744f3d7
Antoine Mercadal authored February 15, 2013

Showing 1 changed file with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. 15  Tools/nib2cib/NSButton.j
15  Tools/nib2cib/NSButton.j
@@ -213,7 +213,7 @@ var NSButtonIsBorderedMask = 0x00800000,
213 213
             fixedHeight = YES;
214 214
     }
215 215
 
216  
-    if ([cell isBordered])
  216
+    if ([cell isBordered] || [self isKindOfClass:[CPRadio class]] || [self isKindOfClass:[CPCheckBox class]])
217 217
     {
218 218
         /*
219 219
             Try to figure out the intention of the theme in regards to fixed height buttons.
@@ -252,11 +252,14 @@ var NSButtonIsBorderedMask = 0x00800000,
252 252
                 CPLog.debug("NSButton [%s]: adjusted height from %d to %d", _title == null ? "<no title>" : '"' + _title + '"', oldHeight, _frame.size.height);
253 253
         }
254 254
 
255  
-        // Reposition the buttons according to its particular offsets
256  
-        _frame.origin.x += positionOffsetOriginX;
257  
-        _frame.origin.y += positionOffsetOriginY;
258  
-        _frame.size.width += positionOffsetSizeWidth;
259  
-        _bounds.size.width += positionOffsetSizeWidth;
  255
+        if ([cell isBordered])
  256
+        {
  257
+            // Reposition the buttons according to its particular offsets
  258
+            _frame.origin.x += positionOffsetOriginX;
  259
+            _frame.origin.y += positionOffsetOriginY;
  260
+            _frame.size.width += positionOffsetSizeWidth;
  261
+            _bounds.size.width += positionOffsetSizeWidth;
  262
+        }
260 263
     }
261 264
 
262 265
     _keyEquivalent = [cell keyEquivalent];

0 notes on commit 6673823

Please sign in to comment.
Something went wrong with that request. Please try again.