diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index c5bc8a2b5..7853d1d5d 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -380,6 +380,8 @@ CPButtonImageOffset = 3.0; _bezelState = CPThemeStateNormal; [self setValue:anImage forThemeAttribute:@"image" inState:_bezelState]; + // if we omit this, images will disappear as soon as the button becomes disabled + [self setValue:anImage forThemeAttribute:@"image" inState:_bezelState.and(CPThemeStateDisabled)]; } - (CPImage)image @@ -971,7 +973,11 @@ CPButtonImageOffset = 3.0; _bezelStyle = aBezelStyle; if (_bezelState && newState) + { + if (currentState) + _bezelState =_bezelState.without(currentState); _bezelState = _bezelState.and(newState); + } else _bezelState = newState || CPThemeStateNormal; diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index 720ed9344..2084ab717 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -819,7 +819,7 @@ var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotificat positioned:CPWindowAbove relativeToEphemeralSubviewNamed:nil]; } - else if (!_contentView) + else { var bezelView = [self layoutEphemeralSubviewNamed:@"bezel-view" positioned:CPWindowBelow @@ -827,9 +827,10 @@ var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotificat [bezelView setBackgroundColor:bezelColor]; - _contentView = [self layoutEphemeralSubviewNamed:@"content-view" - positioned:CPWindowAbove - relativeToEphemeralSubviewNamed:@"bezel-view"]; + if (!_contentView) + _contentView = [self layoutEphemeralSubviewNamed:@"content-view" + positioned:CPWindowAbove + relativeToEphemeralSubviewNamed:@"bezel-view"]; } if (_contentView) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 79ddb93b6..bdf926b09 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -2022,6 +2022,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); } [self setValue:placeholderColor forThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder]; + + [self layoutSubviews]; } - (void)viewDidHide diff --git a/AppKit/CPTreeNode.j b/AppKit/CPTreeNode.j index 9e2871218..0f5f88a33 100644 --- a/AppKit/CPTreeNode.j +++ b/AppKit/CPTreeNode.j @@ -50,6 +50,31 @@ return self; } +- (CPIndexPath)indexPath +{ + if (_parentNode != nil) + { + var path; + var index; + + index = [[_parentNode childNodes] indexOfObject:self]; + path = [_parentNode indexPath]; + + if (path != nil) + { + return [path indexPathByAddingIndex:index]; + } + else + { + return [CPIndexPath indexPathWithIndex:index]; + } + } + else + { + return nil; + } +} + - (BOOL)isLeaf { return [_childNodes count] <= 0; diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 9219f7534..cce918d6f 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -1479,7 +1479,7 @@ var CPViewHighDPIDrawingEnabled = YES; { var mask = [self autoresizingMask]; - if (mask === CPViewNotSizable) + if ((mask === CPViewNotSizable) || !_superview) return; var frame = _superview._frame, diff --git a/AppKit/Themes/Aristo2/ThemeDescriptors.j b/AppKit/Themes/Aristo2/ThemeDescriptors.j index 0fb0bf585..4afa6577c 100644 --- a/AppKit/Themes/Aristo2/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo2/ThemeDescriptors.j @@ -233,6 +233,7 @@ var themedButtonValues = nil, [@"content-inset", CGInsetMake(0.0, 5.0, 0.0, 5.0), [CPThemeStateControlSizeSmall, CPThemeStateBordered]], [@"nib2cib-adjustment-frame", CGRectMake(-3.0, 6.0, 0.0, 0.0), [CPThemeStateControlSizeSmall, CPThemeStateBordered]], + [@"font", [CPFont boldSystemFontOfSize:11.0], [CPThemeStateControlSizeSmall, CPThemeStateBordered]], // RoundRect CPThemeStateControlSizeMini [@"bezel-color", @@ -256,6 +257,7 @@ var themedButtonValues = nil, [@"content-inset", CGInsetMake(0.0, 2.0, 2.0, 2.0), [CPThemeStateControlSizeMini, CPThemeStateBordered]], [@"nib2cib-adjustment-frame", CGRectMake(0.0, 14.0, 0.0, 0.0), [CPThemeStateControlSizeMini, CPThemeStateBordered]], + [@"font", [CPFont boldSystemFontOfSize:10.0], [CPThemeStateControlSizeMini, CPThemeStateBordered]], // Rounded [@"bezel-color", diff --git a/README.markdown b/README.markdown index 087aaeb1d..e9d21482e 100644 --- a/README.markdown +++ b/README.markdown @@ -105,7 +105,9 @@ simply run `npm install -g @objj/cappuccino` again. Getting Started --------------- -To write you first application, [download the starter package](http://www.cappuccino-project.org/#download). +To write you first application, [download the starter package](http://cappuccino.dev/#download). + +To try our new Node (alpha) version of the Cappuccino framework, [check the Node installation instructions](https://github.com/cappuccino/cappuccino/wiki/node) To contribute to Cappuccino, please read here: [Getting and Building the Source]( https://github.com/cappuccino/cappuccino/wiki/Getting-and-building-the-source). diff --git a/Tools/capp/Resources/Templates/NibApplication/AppController.j b/Tools/capp/Resources/Templates/NibApplication/AppController.j index cb34bb65c..3f911c7e5 100644 --- a/Tools/capp/Resources/Templates/NibApplication/AppController.j +++ b/Tools/capp/Resources/Templates/NibApplication/AppController.j @@ -18,6 +18,8 @@ - (void)applicationDidFinishLaunching:(CPNotification)aNotification { // This is called when the application is done loading. + // Uncomment the following line to hide the standard menu bar. + // [CPMenu setMenuBarVisible:NO]; } - (void)awakeFromCib diff --git a/bootstrap.sh b/bootstrap.sh index e8480c33c..af1e1b0d1 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -130,17 +130,14 @@ function check_install_environment () { exit 1 fi - # make sure user is running the Sun JVM or OpenJDK >= 6b18 - java_version=$(java -version 2>&1) - echo $java_version | grep OpenJDK > /dev/null - if [ "$?" = "0" ]; then # OpenJDK: make sure >= 6b18 - openjdk_version=$(echo "$java_version" | grep "OpenJDK Runtime Environment") - openjdk_version_key=$(echo $openjdk_version | egrep -o '[0-9]\-?b[0-9]+') - if [ $(echo $openjdk_version_key | tr -d 'b' | tr -d '-') -lt 618 ]; then - echo "Error: Narwhal is not compatible with your version of OpenJDK: $openjdk_version." - echo "Please upgrade to OpenJDK >= 6b18 or switch to the Sun JVM. Then re-run bootstrap.sh." - exit 1 - fi + # Support Java version 8 or greater + # This is the LTS and last free/unencumbered version from Oracle + # It is also provided by OpenJDK + java_version=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1) + if [ "$java_version" -lt "8" ]; then + echo "Error: Narwhal is not compatible with your the installed Java version: $java_version." + echo "Please upgrade to either Oracle or OpenJDK >= version 7. Then re-run bootstrap.sh." + exit 1 fi }