on mouse up/down only redisplay the affected row

This commit is contained in:
Mitchell Livingston 2007-08-10 04:06:49 +00:00
parent b88ee80099
commit 58621c530b
2 changed files with 4 additions and 10 deletions

View File

@ -22,10 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#ifndef TORRENTCELL_H
#define TORRENTCELL_H
#import "Torrent.h"
#import "CTGradient.h"
@interface TorrentCell : NSCell
@ -44,5 +40,3 @@
- (void) toggleMinimalStatus;
@end
#endif

View File

@ -116,7 +116,7 @@
if ([self pointInActionRect: fClickPoint])
{
[self display]; //ensure button is pushed down
[self setNeedsDisplayInRect: [self rectOfRow: [self rowAtPoint: fClickPoint]]]; //ensure button is pushed down
[self displayTorrentMenuForEvent: event];
fClickPoint = NSZeroPoint;
}
@ -146,8 +146,8 @@
- (void) mouseUp: (NSEvent *) event
{
NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
int row = [self rowAtPoint: point];
BOOL sameRow = row == [self rowAtPoint: fClickPoint];
int row = [self rowAtPoint: point], oldRow = [self rowAtPoint: fClickPoint];
BOOL sameRow = row == oldRow;
if (sameRow && [self pointInPauseRect: point] && [self pointInPauseRect: fClickPoint])
{
@ -180,7 +180,7 @@
[super mouseUp: event];
fClickPoint = NSZeroPoint;
[self display];
[self setNeedsDisplayInRect: [self rectOfRow: oldRow]];
}
- (NSMenu *) menuForEvent: (NSEvent *) event