Fixed a few issues with nib2cib and hiding scrollers.

Reviewed by me.
This commit is contained in:
Francisco Tolmasky committed 2009-05-11 13:45:09 -07:00
1 parent 77c2ab3822
commit 645affad93
4 files changed
+32 -19

No files matched your search

+5
View File
@@ -8,6 +8,11 @@
{
}
+ (CPString)themeClass
{
return @"button-bar";
}
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[nil]
+10 -4
View File
@@ -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];
+9 -10
View File
@@ -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)
+8 -5
View File
@@ -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;