mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Don't hardcode the number of frames in the throbber animation.
This commit is contained in:
parent
b457216712
commit
644f05ed78
@ -652,20 +652,18 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item";
|
||||
|
||||
- (NSArray*)throbberImages
|
||||
{
|
||||
const int kNumThrobberImages = 6;
|
||||
// Simply load an array of NSImage objects from the files "throbber-NN.tif". I used "Quicktime Player" to
|
||||
// save all of the frames of the animated gif as individual .tif files for simplicity of implementation.
|
||||
if (mThrobberImages == nil) {
|
||||
NSImage* images[kNumThrobberImages];
|
||||
for (int i = 0; i < kNumThrobberImages; ++i) {
|
||||
NSImage* images[64];
|
||||
int i;
|
||||
for (i = 0;; ++i) {
|
||||
NSString* imageName = [NSString stringWithFormat: @"throbber-%02d", i + 1];
|
||||
images[i] = [NSImage imageNamed: imageName];
|
||||
if (images[i] == nil) {
|
||||
NSLog(@"throbber image %@ failed to load", imageName);
|
||||
abort();
|
||||
}
|
||||
if (images[i] == nil)
|
||||
break;
|
||||
}
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: kNumThrobberImages];
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: i];
|
||||
}
|
||||
return mThrobberImages;
|
||||
}
|
||||
|
@ -652,20 +652,18 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item";
|
||||
|
||||
- (NSArray*)throbberImages
|
||||
{
|
||||
const int kNumThrobberImages = 6;
|
||||
// Simply load an array of NSImage objects from the files "throbber-NN.tif". I used "Quicktime Player" to
|
||||
// save all of the frames of the animated gif as individual .tif files for simplicity of implementation.
|
||||
if (mThrobberImages == nil) {
|
||||
NSImage* images[kNumThrobberImages];
|
||||
for (int i = 0; i < kNumThrobberImages; ++i) {
|
||||
NSImage* images[64];
|
||||
int i;
|
||||
for (i = 0;; ++i) {
|
||||
NSString* imageName = [NSString stringWithFormat: @"throbber-%02d", i + 1];
|
||||
images[i] = [NSImage imageNamed: imageName];
|
||||
if (images[i] == nil) {
|
||||
NSLog(@"throbber image %@ failed to load", imageName);
|
||||
abort();
|
||||
}
|
||||
if (images[i] == nil)
|
||||
break;
|
||||
}
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: kNumThrobberImages];
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: i];
|
||||
}
|
||||
return mThrobberImages;
|
||||
}
|
||||
|
@ -652,20 +652,18 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item";
|
||||
|
||||
- (NSArray*)throbberImages
|
||||
{
|
||||
const int kNumThrobberImages = 6;
|
||||
// Simply load an array of NSImage objects from the files "throbber-NN.tif". I used "Quicktime Player" to
|
||||
// save all of the frames of the animated gif as individual .tif files for simplicity of implementation.
|
||||
if (mThrobberImages == nil) {
|
||||
NSImage* images[kNumThrobberImages];
|
||||
for (int i = 0; i < kNumThrobberImages; ++i) {
|
||||
NSImage* images[64];
|
||||
int i;
|
||||
for (i = 0;; ++i) {
|
||||
NSString* imageName = [NSString stringWithFormat: @"throbber-%02d", i + 1];
|
||||
images[i] = [NSImage imageNamed: imageName];
|
||||
if (images[i] == nil) {
|
||||
NSLog(@"throbber image %@ failed to load", imageName);
|
||||
abort();
|
||||
}
|
||||
if (images[i] == nil)
|
||||
break;
|
||||
}
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: kNumThrobberImages];
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: i];
|
||||
}
|
||||
return mThrobberImages;
|
||||
}
|
||||
|
@ -652,20 +652,18 @@ static NSString *SearchToolbarItemIdentifier = @"Search Toolbar Item";
|
||||
|
||||
- (NSArray*)throbberImages
|
||||
{
|
||||
const int kNumThrobberImages = 6;
|
||||
// Simply load an array of NSImage objects from the files "throbber-NN.tif". I used "Quicktime Player" to
|
||||
// save all of the frames of the animated gif as individual .tif files for simplicity of implementation.
|
||||
if (mThrobberImages == nil) {
|
||||
NSImage* images[kNumThrobberImages];
|
||||
for (int i = 0; i < kNumThrobberImages; ++i) {
|
||||
NSImage* images[64];
|
||||
int i;
|
||||
for (i = 0;; ++i) {
|
||||
NSString* imageName = [NSString stringWithFormat: @"throbber-%02d", i + 1];
|
||||
images[i] = [NSImage imageNamed: imageName];
|
||||
if (images[i] == nil) {
|
||||
NSLog(@"throbber image %@ failed to load", imageName);
|
||||
abort();
|
||||
}
|
||||
if (images[i] == nil)
|
||||
break;
|
||||
}
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: kNumThrobberImages];
|
||||
mThrobberImages = [[NSArray alloc] initWithObjects: images count: i];
|
||||
}
|
||||
return mThrobberImages;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user