From 4158be90cfd17e5e18265ec84500fc6b2b27e1e1 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 17 Jan 2008 04:20:52 +0000 Subject: [PATCH] avoid weird behavior when pushing down action button by showing the menu on mouse up instead --- macosx/FileOutlineController.m | 1 + macosx/TorrentTableView.m | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/macosx/FileOutlineController.m b/macosx/FileOutlineController.m index deba29fc7..7d924b9ca 100644 --- a/macosx/FileOutlineController.m +++ b/macosx/FileOutlineController.m @@ -264,6 +264,7 @@ typedef enum [[fOutline itemAtRow: i] objectForKey: @"Path"]] inFileViewerRootedAtPath: nil]; } +#warning make real view controller (Leopard-only) so that Command-R will work - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { if (!fTorrent) diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 206ce135d..e7fec3285 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -229,6 +229,17 @@ { NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil]; + //if pushing a button, don't change the selected rows + if ([NSApp isOnLeopardOrBetter] && ([self pointInControlRect: point] || [self pointInRevealRect: point] + || [self pointInActionRect: point])) + fSelectedIndexes = [[self selectedRowIndexes] retain]; + + [super mouseDown: event]; + + [fSelectedIndexes release]; + fSelectedIndexes = nil; + + //avoid weird behavior when showing menu by doing this after mouse down if ([self pointInActionRect: point]) { int row = [self rowAtPoint: point]; @@ -242,16 +253,6 @@ [self setNeedsDisplayInRect: [self rectOfRow: row]]; } - //if pushing a button, don't change the selected rows - if ([NSApp isOnLeopardOrBetter] && ([self pointInControlRect: point] || [self pointInRevealRect: point] - || [self pointInActionRect: point])) - fSelectedIndexes = [[self selectedRowIndexes] retain]; - - [super mouseDown: event]; - - [fSelectedIndexes release]; - fSelectedIndexes = nil; - if ([self pointInMinimalStatusRect: point]) { [fDefaults setBool: ![fDefaults boolForKey: @"DisplaySmallStatusRegular"] forKey: @"DisplaySmallStatusRegular"];