Commits

Anonymous committed c695151

Split view - Added support for thick vertical dividers

Comments (0)

Files changed (1)

 
 - (void)drawDividerInRect:(NSRect)aRect
 {	
-    if ([self isVertical])
-    {
-		aRect.size.width = [self dividerThickness];
-		
+	if ([self dividerThickness] < 1.01)
+	{
 		if (colorIsEnabled && color != nil)
 			[color drawSwatchInRect:aRect];
 		else
 			[super drawDividerInRect:aRect];
-    }
+	}
 	else
 	{
-		aRect.size.height = [self dividerThickness];
-		
-		if ([self dividerThickness] <= 1.01)
-		{
-			if (colorIsEnabled && color != nil)
-				[color drawSwatchInRect:aRect];
-			else
-				[super drawDividerInRect:aRect];
-		}
-		else
-		{
-			[self drawGradientDividerInRect:aRect];
-		}
+		[self drawGradientDividerInRect:aRect];
 	}
 }
 
 {	
 	aRect = [self centerScanRect:aRect];
 
-	// Draw gradient
-	NSRect gradRect = NSMakeRect(aRect.origin.x,aRect.origin.y + 1 / scaleFactor,aRect.size.width,aRect.size.height - 1 / scaleFactor);
-	[gradient drawInRect:gradRect angle:90];
+	if ([self isVertical])
+	{
+		// Draw gradient
+		NSRect gradRect = NSMakeRect(aRect.origin.x + 1 / scaleFactor,aRect.origin.y,aRect.size.width - 1 / scaleFactor,aRect.size.height);
+		[gradient drawInRect:gradRect angle:0];
 	
-	// Draw top and bottom borders
-	[borderColor bwDrawPixelThickLineAtPosition:0 withInset:0 inRect:aRect inView:self horizontal:YES flip:NO];
-	[borderColor bwDrawPixelThickLineAtPosition:0 withInset:0 inRect:aRect inView:self horizontal:YES flip:YES];
+		// Draw left and right borders
+		[borderColor bwDrawPixelThickLineAtPosition:0 withInset:0 inRect:aRect inView:self horizontal:NO flip:NO];
+		[borderColor bwDrawPixelThickLineAtPosition:0 withInset:0 inRect:aRect inView:self horizontal:NO flip:YES];	
+	}
+	else
+	{
+		// Draw gradient
+		NSRect gradRect = NSMakeRect(aRect.origin.x,aRect.origin.y + 1 / scaleFactor,aRect.size.width,aRect.size.height - 1 / scaleFactor);
+		[gradient drawInRect:gradRect angle:90];
+	
+		// Draw top and bottom borders
+		[borderColor bwDrawPixelThickLineAtPosition:0 withInset:0 inRect:aRect inView:self horizontal:YES flip:NO];
+		[borderColor bwDrawPixelThickLineAtPosition:0 withInset:0 inRect:aRect inView:self horizontal:YES flip:YES];		
+	}
 	
 	[self drawDimpleInRect:aRect];
 }
 	}
 }
 
-- (CGFloat)dividerThickness
-{
-	float thickness;
-	
-    if ([self isVertical])
-	{
-		thickness = 1;
-	}
-	else
-	{
-		if ([super dividerThickness] < 1.01)
-			thickness = 1;
-		else
-			thickness = 10;
-	}
-	
-    return thickness;
-}
-
 - (void)setDelegate:(id)anObj
 {
 	if (secondaryDelegate != self)
 	}
 }
 
-#pragma mark Force Vertical Splitters to Thin Appearance
+#pragma mark IB Inspector Support Notifications
 
 // This class doesn't have an appearance for wide vertical splitters, so we force all vertical splitters to thin.
 // We also post notifications that are used by the inspector to show & hide controls.
 	if (aStyle != [self dividerStyle])
 		styleChanged = YES;
 	
-	if ([self isVertical])
-		[super setDividerStyle:NSSplitViewDividerStyleThin];
-	else
-		[super setDividerStyle:aStyle];
+	[super setDividerStyle:aStyle];
 	
 	// There can be sizing issues during design-time if we don't call this
 	[self adjustSubviews];
 	if (flag != [self isVertical])
 		orientationChanged = YES;
 		
-	if (flag)
-		[super setDividerStyle:NSSplitViewDividerStyleThin];
-	
 	[super setVertical:flag];
 	
 	if (orientationChanged)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.