1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

if a button is pushed, don't hilight other buttons when hovered over

This commit is contained in:
Mitchell Livingston 2008-01-15 16:19:16 +00:00
parent ca70ef18bb
commit 6d799f0f89
3 changed files with 21 additions and 10 deletions

View file

@ -297,6 +297,8 @@
NSRect revealRect = [self revealButtonRectForBounds: cellFrame]; NSRect revealRect = [self revealButtonRectForBounds: cellFrame];
BOOL checkReveal = NSMouseInRect(point, revealRect, [controlView isFlipped]); BOOL checkReveal = NSMouseInRect(point, revealRect, [controlView isFlipped]);
[(TorrentTableView *)controlView removeButtonTrackingAreas];
while ([event type] != NSLeftMouseUp) while ([event type] != NSLeftMouseUp)
{ {
point = [controlView convertPoint: [event locationInWindow] fromView: nil]; point = [controlView convertPoint: [event locationInWindow] fromView: nil];
@ -346,6 +348,8 @@
} }
else; else;
[controlView updateTrackingAreas];
return YES; return YES;
} }

View file

@ -48,6 +48,8 @@
- (void) setTorrents: (NSArray *) torrents; - (void) setTorrents: (NSArray *) torrents;
- (void) removeButtonTrackingAreas;
- (void) toggleControlForTorrent: (Torrent *) torrent; - (void) toggleControlForTorrent: (Torrent *) torrent;
- (void) displayTorrentMenuForEvent: (NSEvent *) event; - (void) displayTorrentMenuForEvent: (NSEvent *) event;

View file

@ -94,16 +94,7 @@
{ {
[super updateTrackingAreas]; [super updateTrackingAreas];
fMouseControlRow = -1; [self removeButtonTrackingAreas];
fMouseRevealRow = -1;
NSEnumerator * enumerator = [[self trackingAreas] objectEnumerator];
NSTrackingArea * area;
while ((area = [enumerator nextObject]))
{
if ([area owner] == self && [[area userInfo] objectForKey: @"Row"])
[self removeTrackingArea: area];
}
NSRange visibleRows = [self rowsInRect: [self visibleRect]]; NSRange visibleRows = [self rowsInRect: [self visibleRect]];
if (visibleRows.length == 0) if (visibleRows.length == 0)
@ -123,6 +114,20 @@
} }
} }
- (void) removeButtonTrackingAreas
{
fMouseControlRow = -1;
fMouseRevealRow = -1;
NSEnumerator * enumerator = [[self trackingAreas] objectEnumerator];
NSTrackingArea * area;
while ((area = [enumerator nextObject]))
{
if ([area owner] == self && [[area userInfo] objectForKey: @"Row"])
[self removeTrackingArea: area];
}
}
- (void) mouseEntered: (NSEvent *) event - (void) mouseEntered: (NSEvent *) event
{ {
NSDictionary * dict = (NSDictionary *)[event userData]; NSDictionary * dict = (NSDictionary *)[event userData];