Permalink
Browse files

change names of class methods to [set]GlobalScrollerStyle

  • Loading branch information...
1 parent 697921b commit b37893d9bbfd2a867f472813abea9ec3409b56f7 Antoine Mercadal committed Oct 25, 2011
Showing with 21 additions and 19 deletions.
  1. +21 −19 AppKit/CPScrollView.j
View
@@ -81,8 +81,8 @@ var TIMER_INTERVAL = 0.2,
-var CPScrollerStyleDefault = CPScrollerStyleOverlay,
- CPScrollerStyleDefaultChangeNotification = @"CPScrollerStyleDefaultChangeNotification";
+var CPScrollerStyleGlobal = CPScrollerStyleOverlay,
+ CPScrollerStyleGlobalChangeNotification = @"CPScrollerStyleGlobalChangeNotification";
@implementation CPScrollView : CPView
@@ -124,12 +124,12 @@ var CPScrollerStyleDefault = CPScrollerStyleOverlay,
+ (void)initialize
{
- var defaultValue = [[CPBundle mainBundle] objectForInfoDictionaryKey:@"CPScrollersDefaultStyle"];
+ var globalValue = [[CPBundle mainBundle] objectForInfoDictionaryKey:@"CPScrollersGlobalStyle"];
- if (defaultValue == nil || defaultValue == -1)
- CPScrollerStyleDefault = _isSystemUsingOverlayScrollers() ? CPScrollerStyleOverlay : CPScrollerStyleLegacy
+ if (globalValue == nil || globalValue == -1)
+ CPScrollerStyleGlobal = _isSystemUsingOverlayScrollers() ? CPScrollerStyleOverlay : CPScrollerStyleLegacy
else
- CPScrollerStyleDefault = defaultValue;
+ CPScrollerStyleGlobal = globalValue;
}
+ (CPString)defaultThemeClass
@@ -196,20 +196,22 @@ var CPScrollerStyleDefault = CPScrollerStyleOverlay,
}
}
-/*! Get the current system wide default for scrollers style
+/*!
+ Get the current system wide value for scrollers style
*/
-+ (int)currentDefaultScrollerStyle
++ (int)globalScrollerStyle
{
- return CPScrollerStyleDefault;
+ return CPScrollerStyleGlobal;
}
-/*! Set the current system wide default for scrollers style
- @param aStyle the scroller style you want to use as default
+/*!
+ Set the current system wide value for scrollers style
+ @param aStyle the scroller style you want to use as default (CPScrollerStyleLegacy or CPScrollerStyleOverlay)
*/
-+ (int)setCurrentDefaultScrollerStyle:(int)aStyle
++ (int)setGlobalScrollerStyle:(int)aStyle
{
- CPScrollerStyleDefault = aStyle;
- [[CPNotificationCenter defaultCenter] postNotificationName:CPScrollerStyleDefaultChangeNotification object:nil];
+ CPScrollerStyleGlobal = aStyle;
+ [[CPNotificationCenter defaultCenter] postNotificationName:CPScrollerStyleGlobalChangeNotification object:nil];
}
@@ -242,15 +244,15 @@ var CPScrollerStyleDefault = CPScrollerStyleOverlay,
[self setHasVerticalScroller:YES];
[self setHasHorizontalScroller:YES];
_scrollerKnobStyle = CPScrollerKnobStyleDefault;
- [self setScrollerStyle:CPScrollerStyleDefault];
+ [self setScrollerStyle:CPScrollerStyleGlobal];
_delegate = nil;
_scrollTimer = nil;
_implementedDelegateMethods = 0;
[[CPNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didReceiveDefaultStyleChange:)
- name:CPScrollerStyleDefaultChangeNotification
+ name:CPScrollerStyleGlobalChangeNotification
object:nil];
}
@@ -981,7 +983,7 @@ var CPScrollerStyleDefault = CPScrollerStyleOverlay,
/*! @ignore*/
- (void)_didReceiveDefaultStyleChange:(CPNotification)aNotification
{
- [self setScrollerStyle:CPScrollerStyleDefault];
+ [self setScrollerStyle:CPScrollerStyleGlobal];
}
@@ -1419,12 +1421,12 @@ var CPScrollViewContentViewKey = @"CPScrollViewContentView",
// 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] || CPScrollerStyleDefault];
+ [self setScrollerStyle:[aCoder decodeIntForKey:CPScrollViewScrollerStyleKey] || CPScrollerStyleGlobal];
[self setScrollerKnobStyle:[aCoder decodeIntForKey:CPScrollViewScrollerKnobStyleKey] || CPScrollerKnobStyleDefault];
[[CPNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didReceiveDefaultStyleChange:)
- name:CPScrollerStyleDefaultChangeNotification
+ name:CPScrollerStyleGlobalChangeNotification
object:nil];
}

0 comments on commit b37893d

Please sign in to comment.