зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug 312959: avoid hang showing tooltip on a newly added bookmark toolbar item by ensuring that the bookmark has its title and url before notifications are fired for it, and avoiding "\n\n" tooltip strings. r=mento.
This commit is contained in:
Родитель
10d9b28fce
Коммит
d99cf2fe48
|
@ -109,9 +109,14 @@
|
|||
return;
|
||||
}
|
||||
[self setAction:@selector(openBookmark:)];
|
||||
[self setToolTip:[NSString stringWithFormat:NSLocalizedString(@"BookmarkButtonTooltipFormat", @""),
|
||||
|
||||
NSString* tooltipString = [NSString stringWithFormat:NSLocalizedString(@"BookmarkButtonTooltipFormat", @""),
|
||||
[bookmarkItem title],
|
||||
[bookmarkItem url]]];
|
||||
[bookmarkItem url]];
|
||||
// using "\n\n" as a tooltip string causes Cocoa to hang when displaying the tooltip,
|
||||
// so be paranoid about not doing that
|
||||
if (![tooltipString isEqualToString:@"\n\n"])
|
||||
[self setToolTip:tooltipString];
|
||||
}
|
||||
else {
|
||||
[[self cell] setClickHoldTimeout:0.5];
|
||||
|
|
|
@ -548,8 +548,6 @@ NSString* const BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc";
|
|||
{
|
||||
if (![self isRoot]) {
|
||||
Bookmark *theBookmark = [[Bookmark alloc] init];
|
||||
[self insertChild:theBookmark atIndex:aPosition isMove:NO];
|
||||
[theBookmark release];
|
||||
[theBookmark setTitle:aTitle];
|
||||
[theBookmark setKeyword:aKeyword];
|
||||
[theBookmark setUrl:aURL];
|
||||
|
@ -557,6 +555,8 @@ NSString* const BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc";
|
|||
[theBookmark setLastVisit:aDate];
|
||||
[theBookmark setStatus:aStatus];
|
||||
[theBookmark setIsSeparator:aSeparator];
|
||||
[self insertChild:theBookmark atIndex:aPosition isMove:NO];
|
||||
[theBookmark release];
|
||||
return theBookmark;
|
||||
}
|
||||
return nil;
|
||||
|
|
Загрузка…
Ссылка в новой задаче