Fix 3 tooltip bugs: 285601, 323387 and 311220. When showing tooltips, make sure that their browser is still frontmost, and that their window is the main window. Also hide tooltips when switching tabs.

Also contains a localized string fix related to bug 321882.
This commit is contained in:
smfr%smfr.org 2006-01-16 05:41:00 +00:00
Родитель 9f2b3504fa
Коммит f15f464c52
3 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -754,7 +754,7 @@ enum BWCOpenDest {
IconPopUpCell* iconCell = [[[IconPopUpCell alloc] initWithImage:[NSImage imageNamed:@"popup-blocked"]] autorelease];
[mPopupBlocked setCell:iconCell];
[iconCell setFont:savedFont];
[mPopupBlocked setToolTip:NSLocalizedString(@"A web popup was blocked", "Web Popup Toolitp")];
[mPopupBlocked setToolTip:NSLocalizedString(@"PopupBlockTooltip", @"")];
// [iconCell setPreferredEdge:NSMaxYEdge];
[iconCell setMenu:savedMenu];
[iconCell setBordered:NO];

Просмотреть файл

@ -357,6 +357,8 @@ static NSString* const kOfflineNotificationName = @"offlineModeChanged";
-(void)willResignActiveBrowser
{
[mToolTip closeToolTip];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kOfflineNotificationName object:nil];
[mBrowserView setActive:NO];
}
@ -652,6 +654,11 @@ static NSString* const kOfflineNotificationName = @"offlineModeChanged";
//
- (void)onShowTooltip:(NSPoint)where withText:(NSString*)text
{
// if this tooltip originates from a tab that is (now) in the background,
// or a background window, don't show it.
if (![self window] || ![[self window] isMainWindow])
return;
NSPoint point = [[self window] convertBaseToScreen:[self convertPoint: where toView:nil]];
[mToolTip showToolTipAtPoint: point withString: text overWindow:mWindow];
}

Просмотреть файл

@ -182,8 +182,12 @@ const float kVOffset = 20.0;
- (void)closeToolTip
{
[[mTooltipWindow parentWindow] removeChildWindow:mTooltipWindow];
[mTooltipWindow orderOut:nil];
// we can get -closeToolTip even if we didn't show it
if ([mTooltipWindow isVisible])
{
[[mTooltipWindow parentWindow] removeChildWindow:mTooltipWindow];
[mTooltipWindow orderOut:nil];
}
[[NSNotificationCenter defaultCenter] removeObserver:self];
}