diff --git a/AppKit/CPButtonBar.j b/AppKit/CPButtonBar.j index 5bf1b00f3..e0d66f78f 100644 --- a/AppKit/CPButtonBar.j +++ b/AppKit/CPButtonBar.j @@ -8,6 +8,11 @@ { } ++ (CPString)themeClass +{ + return @"button-bar"; +} + + (id)themeAttributes { return [CPDictionary dictionaryWithObjects:[nil] diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 71237bacd..6db16de7c 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -2199,7 +2199,6 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask", _autoresizesSubviews = [aCoder decodeBoolForKey:CPViewAutoresizesSubviewsKey]; _hitTests = [aCoder decodeObjectForKey:CPViewHitTestsKey]; - _isHidden = [aCoder decodeObjectForKey:CPViewIsHiddenKey]; _opacity = [aCoder decodeIntForKey:CPViewOpacityKey]; // DOM SETUP @@ -2240,8 +2239,13 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask", } [self setNeedsDisplay:YES]; - } + _isHidden = NO; + + if ([aCoder containsValueForKey:CPViewIsHiddenKey]) + [self setHidden:[aCoder decodeBoolForKey:CPViewIsHiddenKey]]; + } + return self; } @@ -2269,9 +2273,11 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask", [aCoder encodeObject:_backgroundColor forKey:CPViewBackgroundColorKey]; [aCoder encodeBool:_hitTests forKey:CPViewHitTestsKey]; - [aCoder encodeBool:_isHidden forKey:CPViewIsHiddenKey]; [aCoder encodeFloat:_opacity forKey:CPViewOpacityKey]; - + + if (_isHidden) + [aCoder encodeBool:_isHidden forKey:CPViewIsHiddenKey]; + [aCoder encodeConditionalObject:[self nextKeyView] forKey:CPViewNextKeyViewKey]; [aCoder encodeConditionalObject:[self previousKeyView] forKey:CPViewPreviousKeyViewKey]; diff --git a/AppKit/CPWebView.j b/AppKit/CPWebView.j index 64456132a..a36bb5082 100644 --- a/AppKit/CPWebView.j +++ b/AppKit/CPWebView.j @@ -180,7 +180,7 @@ CPWebViewScrollNative = 2; // try to get the document size so we can correctly set the frame var win = null; - try { win = [self window]; } catch (e) {} + try { win = [self DOMWindow]; } catch (e) {} if (win && win.document) { @@ -290,7 +290,7 @@ CPWebViewScrollNative = 2; // need to give the browser a chance to reset iframe, otherwise we'll be document.write()-ing the previous document window.setTimeout(function() { - var win = [self window]; + var win = [self DOMWindow]; win.document.write(_html); @@ -385,14 +385,14 @@ CPWebViewScrollNative = 2; _iframe.parentNode.removeChild(_iframe); } -- (Window)window +- (DOMWindow)DOMWindow { return (_iframe.contentDocument && _iframe.contentDocument.defaultView) || _iframe.contentWindow; } - (CPWebScriptObject)windowScriptObject { - var win = [self window]; + var win = [self DOMWindow]; if (!_wso || win != [_wso window]) { if (win) @@ -470,7 +470,7 @@ CPWebViewScrollNative = 2; { try { - [self window].print(); + [self DOMWindow].print(); } catch (e) { diff --git a/AppKit/Themes/Aristo/ThemeDescriptors.j b/AppKit/Themes/Aristo/ThemeDescriptors.j index c133612a0..c1746517a 100644 --- a/AppKit/Themes/Aristo/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo/ThemeDescriptors.j @@ -446,23 +446,22 @@ return slider; } -/* - var buttonBar = [[CPButtonBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 30.0)], ++ (CPButtonBar)themedButtonBar +{ + var buttonBar = [[CPButtonBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 26.0)], color = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices: [ - [_CPCibCustomResource imageResourceWithName:"buttonbar-bezel.png" size:CGSizeMake(1.0, 30.0)], - [_CPCibCustomResource imageResourceWithName:"buttonbar-bezel.png" size:CGSizeMake(1.0, 30.0)], - [_CPCibCustomResource imageResourceWithName:"buttonbar-bezel-right.png" size:CGSizeMake(13.0, 30.0)] + [_CPCibCustomResource imageResourceWithName:"buttonbar-bezel.png" size:CGSizeMake(1.0, 26.0)], + [_CPCibCustomResource imageResourceWithName:"buttonbar-bezel.png" size:CGSizeMake(1.0, 26.0)], + [_CPCibCustomResource imageResourceWithName:"buttonbar-bezel-right.png" size:CGSizeMake(13.0, 26.0)] ] isVertical:NO]]; [buttonBar setValue:color forThemeAttribute:@"bezel-color"]; - [buttonBar setNeedsLayout]; - views.push(buttonBar); - - return views; -*/ + return buttonBar; +} + @end function PatternColor(anImage) diff --git a/Tools/nib2cib/NSScrollView.j b/Tools/nib2cib/NSScrollView.j index 4dded33d6..d53df6e86 100644 --- a/Tools/nib2cib/NSScrollView.j +++ b/Tools/nib2cib/NSScrollView.j @@ -31,14 +31,17 @@ { var flags = [aCoder decodeIntForKey:"NSsFlags"]; - _hasVerticalScroller = Boolean(flags & (1 << 4)); - _hasHorizontalScroller = Boolean(flags & (1 << 5)); - _autohidesScrollers = Boolean(flags & (1 << 9)); - _verticalScroller = [aCoder decodeObjectForKey:"NSVScroller"]; _horizontalScroller = [aCoder decodeObjectForKey:"NSHScroller"]; _contentView = [aCoder decodeObjectForKey:"NSContentView"]; - + + _hasVerticalScroller = !Boolean(flags & (1 << 4)); + _hasHorizontalScroller = !Boolean(flags & (1 << 5)); + _autohidesScrollers = Boolean(flags & (1 << 9)); + + [self setHasHorizontalScroller:!_hasHorizontalScroller]; + [self setHasVerticalScroller:!_hasVerticalScroller]; + //[aCoder decodeBytesForKey:"NSScrollAmts"]; _verticalLineScroll = 10.0; _verticalPageScroll = 10.0;