Skip to content

Commit fb0784d

Browse files
author
Jonathan Dann
committed
started implementing cursor selection
1 parent d260d0c commit fb0784d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Framework/Views/NSViewSubclasses/SplitView/KTSplitViewDivider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@
2222
@property (nonatomic, readwrite, assign) KTSplitView * splitView;
2323
@property (nonatomic, readonly) BOOL isInDrag;
2424
- (id)initWithSplitView:(KTSplitView*)theSplitView;
25+
26+
- (NSCursor *)cursorForCurrentPosition;
2527
@end

Framework/Views/NSViewSubclasses/SplitView/KTSplitViewDivider.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@ - (void)mouseDown:(NSEvent*)theEvent
251251
[self mouseUp:anUpOrDraggedEvent];
252252
}
253253

254+
- (NSCursor *)cursorForCurrentPosition;
255+
{
256+
if([[self splitView] dividerOrientation] == KTSplitViewDividerOrientation_Horizontal)
257+
{
258+
return [NSCursor resizeUpDownCursor];
259+
}
260+
else
261+
{
262+
return [NSCursor resizeLeftRightCursor];
263+
}
264+
}
254265

255266
//===========================================================
256267
// - mouseDragged
@@ -281,7 +292,7 @@ To support split view handles (those generally in some sort of toolbar,
281292
if( aPoint >= aSplitViewBounds.origin.x
282293
&& aPoint <= aSplitViewFrame.size.height-aDividerBounds.size.height )
283294
{
284-
[[NSCursor resizeUpDownCursor] set];
295+
[self _setCursor:[self cursorForCurrentPosition]];
285296
NSRect aRect = aDividerFrame;
286297
aPoint = [[self splitView] dividerPositionForProposedPosition:aPoint];
287298
[self setFrame:NSMakeRect(aRect.origin.x, aPoint,
@@ -294,7 +305,7 @@ To support split view handles (those generally in some sort of toolbar,
294305
if( aPoint >= aSplitViewBounds.origin.y
295306
&& aPoint <= aSplitViewFrame.size.width-aDividerBounds.size.width)
296307
{
297-
[[NSCursor resizeLeftRightCursor] set];
308+
[self _setCursor:[self cursorForCurrentPosition]];
298309
NSRect aRect = aDividerFrame;
299310
aPoint = [[self splitView] dividerPositionForProposedPosition:aPoint];
300311
[self setFrame:NSMakeRect(aPoint, aRect.origin.y,

0 commit comments

Comments
 (0)