mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
avoid weird behavior when pushing down action button by showing the menu on mouse up instead
This commit is contained in:
parent
52c3243b4b
commit
4158be90cf
2 changed files with 12 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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"];
|
||||
|
|
Loading…
Reference in a new issue