Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (33 sloc) 876 Bytes
//
// PBUnsortableTableHeader.m
// GitX
//
// Created by Pieter de Bie on 03-10-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "PBUnsortableTableHeader.h"
@implementation PBUnsortableTableHeader
- (void)mouseDown:(NSEvent *)theEvent
{
NSPoint location = [self convertPoint:[[self window] mouseLocationOutsideOfEventStream] fromView:[[self window] contentView]];
int aColumnIndex = [self columnAtPoint:location];
// If the user pressed on another column, reset
if (aColumnIndex != columnIndex)
{
clickCount = 1;
columnIndex = aColumnIndex;
[super mouseDown:theEvent];
return;
}
// On the third click, reset the sorting and
// Don't pass on the click
if (++clickCount == 3)
{
clickCount = 0;
controller.sortDescriptors = [NSArray array];
[controller rearrangeObjects];
return;
}
[super mouseDown:theEvent];
}
@end
Something went wrong with that request. Please try again.