forked from ttscoff/nv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ETOverlayScroller.m
50 lines (41 loc) · 1.12 KB
/
ETOverlayScroller.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// ETOverlayScroller.m
// Notation
//
// Created by elasticthreads on 9/15/11.
// Copyright 2011 elasticthreads. All rights reserved.
//
#import "ETOverlayScroller.h"
@implementation ETOverlayScroller
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ (BOOL)isCompatibleWithOverlayScrollers {
return self == [ETOverlayScroller class];
}
- (void)setScrollerStyle:(NSScrollerStyle)newScrollerStyle{
if (IsLionOrLater&&(newScrollerStyle==NSScrollerStyleOverlay)) {
verticalPaddingLeft = 4.5f;
}else{
verticalPaddingLeft = 4.0f;
}
[super setScrollerStyle:newScrollerStyle];
}
+ (NSScrollerStyle)preferredScrollerStyle{
return NSScrollerStyleOverlay;
}
#endif
- (id)initWithFrame:(NSRect)frameRect{
if ((self=[super initWithFrame:frameRect])) {
verticalPaddingRight = 3.0f;
if (IsLionOrLater&&([self scrollerStyle]==NSScrollerStyleOverlay)) {
verticalPaddingLeft = 4.5f;
}else{
verticalPaddingLeft = 4.0f;
}
knobAlpha=0.6f;
slotAlpha=0.55f;
fillBackground=NO;
isOverlay=YES;
}
return self;
}
@end