mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-25 11:50:42 +00:00
Merge branch 'master' of github.com:cappuccino/cappuccino
This commit is contained in:
+24
-8
@@ -751,35 +751,42 @@ Notifies the delegate when the scroll view has finished scrolling.
|
||||
{
|
||||
[_horizontalScroller setStyle:_scrollerStyle];
|
||||
[_horizontalScroller unsetThemeState:CPThemeStateSelected];
|
||||
|
||||
switch (_scrollerKnobStyle)
|
||||
{
|
||||
case CPScrollerKnobStyleLight:
|
||||
[_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
|
||||
[_horizontalScroller setThemeState:CPThemeStateScrollerKnobLight];
|
||||
break;
|
||||
|
||||
case CPScrollerKnobStyleDark:
|
||||
[_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
|
||||
[_horizontalScroller setThemeState:CPThemeStateScrollerKnobDark];
|
||||
break;
|
||||
|
||||
default:
|
||||
[_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
|
||||
[_horizontalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
|
||||
}
|
||||
}
|
||||
|
||||
if (_hasVerticalScroller)
|
||||
{
|
||||
[_verticalScroller setStyle:_scrollerStyle];
|
||||
[_verticalScroller unsetThemeState:CPThemeStateSelected];
|
||||
|
||||
switch (_scrollerKnobStyle)
|
||||
{
|
||||
case CPScrollerKnobStyleLight:
|
||||
[_verticalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
|
||||
[_verticalScroller setThemeState:CPThemeStateScrollerKnobLight];
|
||||
break;
|
||||
|
||||
case CPScrollerKnobStyleDark:
|
||||
[_verticalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
|
||||
[_verticalScroller setThemeState:CPThemeStateScrollerKnobDark];
|
||||
break;
|
||||
|
||||
default:
|
||||
[_verticalScroller unsetThemeState:CPThemeStateScrollerKnobLight];
|
||||
[_verticalScroller unsetThemeState:CPThemeStateScrollerKnobDark];
|
||||
@@ -790,6 +797,7 @@ Notifies the delegate when the scroll view has finished scrolling.
|
||||
{
|
||||
if (_timerScrollersHide)
|
||||
[_timerScrollersHide invalidate];
|
||||
|
||||
_timerScrollersHide = [CPTimer scheduledTimerWithTimeInterval:CPScrollViewFadeOutTime target:self selector:@selector(_hideScrollers:) userInfo:nil repeats:NO];
|
||||
[[self bottomCornerView] setHidden:YES];
|
||||
}
|
||||
@@ -870,6 +878,7 @@ Notifies the delegate when the scroll view has finished scrolling.
|
||||
var frame = [self _insetBounds];
|
||||
|
||||
frame.size.height = _CGRectGetHeight([headerView frame]);
|
||||
|
||||
if (SHOULD_SHOW_CORNER_VIEW())
|
||||
frame.size.width -= _CGRectGetWidth([self _cornerViewFrame]);
|
||||
|
||||
@@ -1230,6 +1239,7 @@ Notifies the delegate when the scroll view has finished scrolling.
|
||||
|
||||
if (_timerScrollersHide)
|
||||
[_timerScrollersHide invalidate]
|
||||
|
||||
_timerScrollersHide = [CPTimer scheduledTimerWithTimeInterval:CPScrollViewFadeOutTime target:self selector:@selector(_hideScrollers:) userInfo:nil repeats:NO];
|
||||
}
|
||||
|
||||
@@ -1496,21 +1506,27 @@ var CPScrollViewContentViewKey = @"CPScrollViewContentView",
|
||||
_scrollTimer = nil;
|
||||
_implementedDelegateMethods = 0;
|
||||
|
||||
// Due to the anything goes nature of decoding, our subviews may not exist yet, so layout at the end of the run loop when we're sure everything is in a correct state.
|
||||
[[CPRunLoop currentRunLoop] performSelector:@selector(_updateCornerAndHeaderView) target:self argument:_contentView order:0 modes:[CPDefaultRunLoopMode]];
|
||||
|
||||
[self setScrollerStyle:[aCoder decodeIntForKey:CPScrollViewScrollerStyleKey] || CPScrollerStyleGlobal];
|
||||
[self setScrollerKnobStyle:[aCoder decodeIntForKey:CPScrollViewScrollerKnobStyleKey] || CPScrollerKnobStyleDefault];
|
||||
_scrollerStyle = [aCoder decodeIntForKey:CPScrollViewScrollerStyleKey] || CPScrollerStyleGlobal;
|
||||
_scrollerKnobStyle = [aCoder decodeIntForKey:CPScrollViewScrollerKnobStyleKey] || CPScrollerKnobStyleDefault;
|
||||
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_didReceiveDefaultStyleChange:)
|
||||
name:CPScrollerStyleGlobalChangeNotification
|
||||
object:nil];
|
||||
selector:@selector(_didReceiveDefaultStyleChange:)
|
||||
name:CPScrollerStyleGlobalChangeNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
Do final init that can only be done when we are sure all subviews have been initialized.
|
||||
*/
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
[self _updateScrollerStyle];
|
||||
[self _updateCornerAndHeaderView];
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[super encodeWithCoder:aCoder];
|
||||
|
||||
+7
-2
@@ -771,6 +771,7 @@ CPThemeStateScrollerKnobDark = CPThemeState("scroller-knob-dark");
|
||||
|
||||
if (_timerFadeOut)
|
||||
[_timerFadeOut invalidate];
|
||||
|
||||
_timerFadeOut = [CPTimer scheduledTimerWithTimeInterval:1.2 target:self selector:@selector(_performFadeOut:) userInfo:nil repeats:NO];
|
||||
}
|
||||
|
||||
@@ -796,10 +797,12 @@ var CPScrollerControlSizeKey = @"CPScrollerControlSize",
|
||||
if (self = [super initWithCoder:aCoder])
|
||||
{
|
||||
_controlSize = CPRegularControlSize;
|
||||
|
||||
if ([aCoder containsValueForKey:CPScrollerControlSizeKey])
|
||||
_controlSize = [aCoder decodeIntForKey:CPScrollerControlSizeKey];
|
||||
|
||||
_knobProportion = 1.0;
|
||||
|
||||
if ([aCoder containsValueForKey:CPScrollerKnobProportionKey])
|
||||
_knobProportion = [aCoder decodeFloatForKey:CPScrollerKnobProportionKey];
|
||||
|
||||
@@ -809,8 +812,10 @@ var CPScrollerControlSizeKey = @"CPScrollerControlSize",
|
||||
|
||||
_allowFadingOut = YES;
|
||||
_isMouseOver = NO;
|
||||
var paramAnimFadeOut = [CPDictionary dictionaryWithObjects:[self, CPViewAnimationFadeOutEffect]
|
||||
forKeys:[CPViewAnimationTargetKey, CPViewAnimationEffectKey]];
|
||||
|
||||
var paramAnimFadeOut = [CPDictionary dictionaryWithObjects:[self, CPViewAnimationFadeOutEffect]
|
||||
forKeys:[CPViewAnimationTargetKey, CPViewAnimationEffectKey]];
|
||||
|
||||
_animationScroller = [[CPViewAnimation alloc] initWithDuration:0.2 animationCurve:CPAnimationEaseInOut];
|
||||
[_animationScroller setViewAnimations:[paramAnimFadeOut]];
|
||||
[_animationScroller setDelegate:self];
|
||||
|
||||
@@ -51,9 +51,11 @@
|
||||
case "Default":
|
||||
[scrollView setScrollerKnobStyle:CPScrollerKnobStyleDefault];
|
||||
break;
|
||||
|
||||
case "Dark":
|
||||
[scrollView setScrollerKnobStyle:CPScrollerKnobStyleDark];
|
||||
break;
|
||||
|
||||
case "Light":
|
||||
[scrollView setScrollerKnobStyle:CPScrollerKnobStyleLight];
|
||||
break;
|
||||
@@ -69,6 +71,7 @@
|
||||
case "Light":
|
||||
[[scrollView documentView] setBackgroundColor:lightBackground];
|
||||
break;
|
||||
|
||||
case "Dark":
|
||||
[[scrollView documentView] setBackgroundColor:[CPColor colorWithHexString:@"333"]];
|
||||
break;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,13 +2,13 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">11C74</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.23</string>
|
||||
<string key="IBDocument.HIToolboxVersion">567.00</string>
|
||||
<string key="IBDocument.SystemVersion">11D50</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.32</string>
|
||||
<string key="IBDocument.HIToolboxVersion">568.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1938</string>
|
||||
<string key="NS.object.0">2182</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -1420,9 +1420,9 @@
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
<object class="NSMenuItem" key="NSMenuItem" id="914668909">
|
||||
<object class="NSMenuItem" key="NSMenuItem" id="642897130">
|
||||
<reference key="NSMenu" ref="647805982"/>
|
||||
<string key="NSTitle">Dark</string>
|
||||
<string key="NSTitle">Default</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
@@ -1437,10 +1437,10 @@
|
||||
<string key="NSTitle">OtherViews</string>
|
||||
<object class="NSMutableArray" key="NSMenuItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="914668909"/>
|
||||
<object class="NSMenuItem" id="1191465">
|
||||
<reference ref="642897130"/>
|
||||
<object class="NSMenuItem" id="914668909">
|
||||
<reference key="NSMenu" ref="647805982"/>
|
||||
<string key="NSTitle">Light</string>
|
||||
<string key="NSTitle">Dark</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
@@ -1449,9 +1449,9 @@
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="448836112"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="642897130">
|
||||
<object class="NSMenuItem" id="1191465">
|
||||
<reference key="NSMenu" ref="647805982"/>
|
||||
<string key="NSTitle">Default</string>
|
||||
<string key="NSTitle">Light</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
@@ -1630,7 +1630,7 @@
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1023031372"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -3920,7 +3920,7 @@
|
||||
<string>83.IBPluginDependency</string>
|
||||
<string>92.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -4142,7 +4142,7 @@
|
||||
<string>makeShortDocView:</string>
|
||||
<string>makeSmallDocView:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
@@ -4169,7 +4169,7 @@
|
||||
<string>makeShortDocView:</string>
|
||||
<string>makeSmallDocView:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">change:</string>
|
||||
@@ -4218,7 +4218,7 @@
|
||||
<string>scrollView</string>
|
||||
<string>scrollView2</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSView</string>
|
||||
<string>NSView</string>
|
||||
@@ -4235,7 +4235,7 @@
|
||||
<string>scrollView</string>
|
||||
<string>scrollView2</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">contentView</string>
|
||||
@@ -4260,73 +4260,6 @@
|
||||
<string key="minorKey">./Classes/AppController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSDocument</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>printDocument:</string>
|
||||
<string>revertDocumentToSaved:</string>
|
||||
<string>runPageLayout:</string>
|
||||
<string>saveDocument:</string>
|
||||
<string>saveDocumentAs:</string>
|
||||
<string>saveDocumentTo:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>printDocument:</string>
|
||||
<string>revertDocumentToSaved:</string>
|
||||
<string>runPageLayout:</string>
|
||||
<string>saveDocument:</string>
|
||||
<string>saveDocumentAs:</string>
|
||||
<string>saveDocumentTo:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">printDocument:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">revertDocumentToSaved:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">runPageLayout:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">saveDocument:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">saveDocumentAs:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">saveDocumentTo:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/NSDocument.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
@@ -4348,10 +4281,10 @@
|
||||
<string>NSMenuCheckmark</string>
|
||||
<string>NSMenuMixedState</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{9, 8}</string>
|
||||
<string>{7, 2}</string>
|
||||
<string>{11, 11}</string>
|
||||
<string>{10, 3}</string>
|
||||
</object>
|
||||
</object>
|
||||
</data>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -41,10 +41,10 @@
|
||||
|
||||
[self addSubview:_bottomCornerView];
|
||||
|
||||
var knobStyle = 0;
|
||||
try { knobStyle = [aCoder decodeObjectForKey:"NSScrollerKnobStyle"]; } catch (e){}
|
||||
_scrollerKnobStyle = [aCoder decodeObjectForKey:"NSScrollerKnobStyle"];
|
||||
|
||||
[self setScrollerKnobStyle:knobStyle];
|
||||
if (_scrollerKnobStyle === nil)
|
||||
_scrollerKnobStyle = CPScrollerKnobStyleDefault;
|
||||
|
||||
_hasVerticalScroller = !!(flags & (1 << 4));
|
||||
_hasHorizontalScroller = !!(flags & (1 << 5));
|
||||
|
||||
Reference in New Issue
Block a user