Skip to content

Commit

Permalink
if the gear image is set to only display on mouseover, it now is also…
Browse files Browse the repository at this point in the history
… displayed if the mouse *starts* inside the view (fixes bug #231)

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information
Simone Manganelli authored and rentzsch committed Jul 3, 2009
1 parent ec02988 commit 76670d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ - (void) _revertToOriginalOpacityAttributes;

- (void) _drawBackground;
- (BOOL) _isOptionPressed;
- (void) _checkMouseLocation;
- (void) _addTrackingAreaForCTF;
- (void) _removeTrackingAreaForCTF;

Expand Down Expand Up @@ -363,6 +364,7 @@ - (id) initWithArguments:(NSDictionary *)arguments

[self setOriginalOpacityAttributes:originalOpacityDict];

[self _checkMouseLocation];
[self _addTrackingAreaForCTF];
}

Expand Down Expand Up @@ -893,6 +895,18 @@ - (void) _drawBackground
}
}

- (void) _checkMouseLocation
{
NSPoint mouseLoc = [NSEvent mouseLocation];

BOOL nowInside = NSPointInRect(mouseLoc, [_webView bounds]);
if (nowInside) {
mouseInside = YES;
} else {
mouseInside = NO;
}
}

- (void) _addTrackingAreaForCTF
{
if (trackingArea)
Expand Down

0 comments on commit 76670d2

Please sign in to comment.