1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-04 05:22:40 +00:00

don't make a button hovered when it is pushed but not hovered over

This commit is contained in:
Mitchell Livingston 2008-01-15 04:52:40 +00:00
parent edb46062b2
commit 803cbc6808
2 changed files with 8 additions and 4 deletions

View file

@ -31,7 +31,7 @@
NSMutableDictionary * fTitleAttributes, * fStatusAttributes;
BOOL fMouseDownControlButton, fMouseDownRevealButton, fHoverControl, fHoverReveal;
BOOL fTracking, fMouseDownControlButton, fMouseDownRevealButton, fHoverControl, fHoverReveal;
NSColor * fBarOverlayColor;
CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient,

View file

@ -283,6 +283,8 @@
- (BOOL) trackMouse: (NSEvent *) event inRect: (NSRect) cellFrame ofView: (NSView *) controlView untilMouseUp: (BOOL) flag
{
fTracking = YES;
[self setControlView: controlView];
NSPoint point = [controlView convertPoint: [event locationInWindow] fromView: nil];
@ -325,6 +327,8 @@
event = [[controlView window] nextEventMatchingMask:
(NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseEnteredMask | NSMouseExitedMask)];
}
fTracking = NO;
if (fMouseDownControlButton)
{
@ -502,7 +506,7 @@
#warning get hover images
//control button
NSString * controlImageSuffix = fMouseDownControlButton || fHoverControl ? @"On.png" : @"Off.png";
NSString * controlImageSuffix = fMouseDownControlButton || (!fTracking && fHoverControl) ? @"On.png" : @"Off.png";
NSImage * controlImage;
if ([torrent isActive])
controlImage = [NSImage imageNamed: [@"Pause" stringByAppendingString: controlImageSuffix]];
@ -521,7 +525,7 @@
if (fMouseDownControlButton)
controlImage = [NSImage imageNamed: @"ResumeOn.png"];
else if (fHoverControl)
else if (!fTracking && fHoverControl)
controlImage = [NSImage imageNamed: @"ResumeNoWaitOff.png"];
else
controlImage = [NSImage imageNamed: @"ResumeOff.png"];*/
@ -531,7 +535,7 @@
fraction: 1.0];
//reveal button
NSString * revealImageSuffix = fMouseDownRevealButton || fHoverReveal ? @"On.png" : @"Off.png";
NSString * revealImageSuffix = fMouseDownRevealButton || (!fTracking && fHoverReveal) ? @"On.png" : @"Off.png";
NSImage * revealImage = [NSImage imageNamed: [@"Reveal" stringByAppendingString: revealImageSuffix]];
[revealImage setFlipped: YES];
[revealImage drawInRect: [self revealButtonRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver