]> granicus.if.org Git - transmission/commitdiff
trivial torrent table change
authorMitchell Livingston <livings124@transmissionbt.com>
Mon, 17 Nov 2008 03:20:15 +0000 (03:20 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Mon, 17 Nov 2008 03:20:15 +0000 (03:20 +0000)
macosx/TorrentTableView.m

index 56159b942d5b4befe1b0d5f883b96eab5e9a0383..f3401dd6629e9f9666e0be175ac1882a2f849c81 100644 (file)
@@ -43,6 +43,7 @@
 
 @interface TorrentTableView (Private)
 
+//unused on Leopard
 - (BOOL) pointInControlRect: (NSPoint) point;
 - (BOOL) pointInRevealRect: (NSPoint) point;
 - (BOOL) pointInActionRect: (NSPoint) point;
         [self setNeedsDisplayInRect: [self rectOfRow: row]];
 }
 
-//when Leopard-only, use these variables instead of pointInActionRect:, etc.
 - (void) mouseEntered: (NSEvent *) event
 {
     NSDictionary * dict = (NSDictionary *)[event userData];
 - (void) mouseDown: (NSEvent *) event
 {
     NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
+    const NSInteger row = [self rowAtPoint: point];
     
     //check to toggle group status before anything else
     if ([self pointInGroupStatusRect: point])
         return;
     }
     
-    BOOL pushed = [self pointInControlRect: point] || [self pointInRevealRect: point] || [self pointInActionRect: point];
+    BOOL pushed;
+    if ([NSApp isOnLeopardOrBetter])
+        pushed = fMouseActionRow == row || fMouseRevealRow == row || fMouseControlRow == row;
+    else
+        pushed = [self pointInControlRect: point] || [self pointInRevealRect: point] || [self pointInActionRect: point];
     
     //if pushing a button, don't change the selected rows
     if (pushed)
     //avoid weird behavior when showing menu by doing this after mouse down
     if ([self pointInActionRect: point])
     {
-        NSInteger row = [self rowAtPoint: point];
-        
         fActionPushedRow = row;
         [self setNeedsDisplayInRect: [self rectOfRow: row]]; //ensure button is pushed down
         
     else if (!pushed && [event clickCount] == 2) //double click
     {
         id item = nil;
-        NSInteger row = [self rowAtPoint: point];
         if (row != -1)
             item = [self itemAtRow: row];