From 563fb657a46bba23ee9e6c04afaf401fe632ade7 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Wed, 6 Feb 2013 17:01:27 -0800 Subject: [PATCH] Change some pixel adjustements to reflect what IB is doing in nib2cib --- Tools/nib2cib/NSButton.j | 4 ++-- Tools/nib2cib/NSColorWell.j | 3 --- Tools/nib2cib/NSComboBox.j | 13 +++++++++---- Tools/nib2cib/NSSegmentedControl.j | 2 +- Tools/nib2cib/NSSlider.j | 8 ++++---- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Tools/nib2cib/NSButton.j b/Tools/nib2cib/NSButton.j index da6ad9c72..015ec93fd 100644 --- a/Tools/nib2cib/NSButton.j +++ b/Tools/nib2cib/NSButton.j @@ -130,8 +130,8 @@ var NSButtonIsBorderedMask = 0x00800000, // implemented: case CPRoundedBezelStyle: // Push IB style positionOffsetOriginY = 6; - positionOffsetOriginX = 4; - positionOffsetSizeWidth = -12; + positionOffsetOriginX = 6; + positionOffsetSizeWidth = -12 fixedHeight = YES; break; diff --git a/Tools/nib2cib/NSColorWell.j b/Tools/nib2cib/NSColorWell.j index 9630f0301..dbb0a0042 100644 --- a/Tools/nib2cib/NSColorWell.j +++ b/Tools/nib2cib/NSColorWell.j @@ -45,9 +45,6 @@ CPLog.debug("NSColorWell: adjusting height from %d to %d", frameSize.height, 24.0); frameSize.height = 24.0; [self setFrameSize:frameSize]; - - // Adjust for differences between Cocoa and Cappuccino widget framing. - _frame.origin.x -= 3; } } diff --git a/Tools/nib2cib/NSComboBox.j b/Tools/nib2cib/NSComboBox.j index d59df7ca8..08434c265 100644 --- a/Tools/nib2cib/NSComboBox.j +++ b/Tools/nib2cib/NSComboBox.j @@ -47,12 +47,17 @@ // Make sure the height is clipped to the max given by the theme var maxSize = [[[Converter sharedConverter] themes][0] valueForAttributeWithName:@"max-size" forClass:[CPComboBox class]], - size = [self frameSize]; - - [self setFrameSize:CGSizeMake(size.width, MIN(size.height, maxSize.height))]; + size = [self frameSize], + widthOffset = -3; // Adjust for differences between Cocoa and Cappuccino widget framing. - _frame.origin.x += 1; + if ([[[Converter sharedConverter] themes][0] name] == @"Aristo") + { + _frame.origin.x += 1; + widthOffset = -5; + } + + [self setFrameSize:CGSizeMake(size.width + widthOffset, MIN(size.height, maxSize.height))]; } return self; diff --git a/Tools/nib2cib/NSSegmentedControl.j b/Tools/nib2cib/NSSegmentedControl.j index aef067f95..35394ec49 100644 --- a/Tools/nib2cib/NSSegmentedControl.j +++ b/Tools/nib2cib/NSSegmentedControl.j @@ -63,7 +63,7 @@ } // Adjust for differences between Cocoa and Cappuccino widget framing. - frame.origin.x += 4; + frame.origin.x += 6; if ([[[Converter sharedConverter] themes][0] name] == @"Aristo2") frame.size.height += 1; diff --git a/Tools/nib2cib/NSSlider.j b/Tools/nib2cib/NSSlider.j index d842999ae..0781c46e3 100644 --- a/Tools/nib2cib/NSSlider.j +++ b/Tools/nib2cib/NSSlider.j @@ -43,12 +43,12 @@ [self setSliderType:[cell sliderType]]; - if ([self sliderType] === CPCircularSlider) - { - var frame = [self frame]; + var frame = [self frame]; + if ([self sliderType] === CPCircularSlider) [self setFrameSize:CGSizeMake(frame.size.width + 4.0, frame.size.height + 2.0)]; - } + else + [self setFrame:CGRectMake(frame.origin.x + 2, frame.origin.y, frame.size.width - 4, frame.size.height)]; } return self;