mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
get button hilighting working correctly when it assumes it's inside the button
This commit is contained in:
@@ -363,9 +363,8 @@
|
||||
NSTrackingAreaOptions controlOptions = options;
|
||||
if (NSMouseInRect(mouseLocation, controlButtonRect, [controlView isFlipped]))
|
||||
{
|
||||
#warning update control view
|
||||
controlOptions |= NSTrackingAssumeInside;
|
||||
[controlView setNeedsDisplayInRect: controlButtonRect];
|
||||
[(TorrentTableView *)controlView setControlButtonHover: [[userInfo objectForKey: @"Row"] intValue]];
|
||||
}
|
||||
|
||||
NSMutableDictionary * controlInfo = [userInfo mutableCopy];
|
||||
@@ -382,7 +381,7 @@
|
||||
if (NSMouseInRect(mouseLocation, revealButtonRect, [controlView isFlipped]))
|
||||
{
|
||||
revealOptions |= NSTrackingAssumeInside;
|
||||
[controlView setNeedsDisplayInRect: revealButtonRect];
|
||||
[(TorrentTableView *)controlView setRevealButtonHover: [[userInfo objectForKey: @"Row"] intValue]];
|
||||
}
|
||||
|
||||
NSMutableDictionary * revealInfo = [userInfo mutableCopy];
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
- (void) setTorrents: (NSArray *) torrents;
|
||||
|
||||
- (void) removeButtonTrackingAreas;
|
||||
- (void) setControlButtonHover: (int) row;
|
||||
- (void) setRevealButtonHover: (int) row;
|
||||
|
||||
- (void) toggleControlForTorrent: (Torrent *) torrent;
|
||||
|
||||
|
||||
@@ -128,6 +128,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setControlButtonHover: (int) row
|
||||
{
|
||||
fMouseControlRow = row;
|
||||
if (row >= 0)
|
||||
[self setNeedsDisplayInRect: [self rectOfRow: row]];
|
||||
}
|
||||
|
||||
- (void) setRevealButtonHover: (int) row
|
||||
{
|
||||
fMouseRevealRow = row;
|
||||
if (row >= 0)
|
||||
[self setNeedsDisplayInRect: [self rectOfRow: row]];
|
||||
}
|
||||
|
||||
- (void) mouseEntered: (NSEvent *) event
|
||||
{
|
||||
NSDictionary * dict = (NSDictionary *)[event userData];
|
||||
|
||||
Reference in New Issue
Block a user