Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

always with the double commit for one fix. more scroller fixes.

  • Loading branch information...
commit 93891b718fbce7340a6fd6b5566d6633bebefaf9 1 parent a03ba3b
@elasticthreads elasticthreads authored
Showing with 36 additions and 18 deletions.
  1. +20 −2 ETOverlayScroller.m
  2. +12 −10 ETScrollView.m
  3. +4 −6 ETTransparentScroller.m
View
22 ETOverlayScroller.m
@@ -14,12 +14,30 @@ @implementation ETOverlayScroller
+ (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])) {
- verticalPaddingLeft = 5.0f;
- verticalPaddingRight = 2.5f;
+ verticalPaddingRight = 3.0f;
+ if (IsLionOrLater&&([self scrollerStyle]==NSScrollerStyleOverlay)) {
+ verticalPaddingLeft = 4.5f;
+ }else{
+ verticalPaddingLeft = 4.0f;
+ }
knobAlpha=0.6f;
slotAlpha=0.55f;
fillBackground=NO;
View
22 ETScrollView.m
@@ -78,18 +78,20 @@ - (void)settingChangedForSelectorString:(NSString*)selectorString{
}
- (void)changeUseETScrollbarsOnLion{
- if ([[GlobalPrefs defaultPrefs]useETScrollbarsOnLion]) {
- id theScroller=[[scrollerClass alloc]init];
- [self setVerticalScroller:theScroller];
- [theScroller release];
-
+ NSScrollerStyle style=[self scrollerStyle];
+ id theScroller;
+ if ([[GlobalPrefs defaultPrefs]useETScrollbarsOnLion]) {
+ theScroller=[[scrollerClass alloc]init];
}else{
- NSScroller *theScroller=[[NSScroller alloc]init];
- [self setVerticalScroller:theScroller];
- [theScroller release];
-
+ theScroller=[[NSScroller alloc]init];
+ if (style==NSScrollerStyleLegacy) {
+ style=[NSScroller preferredScrollerStyle];
+ }
}
-// [self setScrollerStyle:NSScrollerStyleOverlay];
+ [theScroller setScrollerStyle:style];
+ [self setVerticalScroller:theScroller];
+ [theScroller release];
+ [self setScrollerStyle:style];
[self tile];
[self reflectScrolledClipView:[self contentView]];
}
View
10 ETTransparentScroller.m
@@ -9,9 +9,9 @@
#import "ETTransparentScroller.h"
-@interface NSScroller (NVTSPrivate)
-- (NSRect)_drawingRectForPart:(NSScrollerPart)aPart;
-@end
+//@interface NSScroller (NVTSPrivate)
+//- (NSRect)_drawingRectForPart:(NSScrollerPart)aPart;
+//@end
@implementation ETTransparentScroller
@@ -64,9 +64,7 @@ + (CGFloat)scrollerWidthForControlSize:(NSControlSize)controlSize scrollerStyle:
return 15.0;
}
//
-+ (NSScrollerStyle)preferredScrollerStyle{
- return NSScrollerStyleOverlay;
-}
+
//+ (BOOL)isCompatibleWithOverlayScrollers {
Please sign in to comment.
Something went wrong with that request. Please try again.