mirror of
https://github.com/transmission/transmission
synced 2025-03-06 03:28:33 +00:00
Generate the pieces images in code rather than using files.
This commit is contained in:
parent
ff499d0328
commit
19b89fa7ea
8 changed files with 57 additions and 51 deletions
|
@ -7,13 +7,6 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
3518E4D40AC62517002ED3A2 /* BoxBlue2.tiff in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */; };
|
||||
3518E5210AC62A29002ED3A2 /* PiecesBack.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E4CD0AC62517002ED3A2 /* PiecesBack.tiff */; };
|
||||
3518E5230AC62A2A002ED3A2 /* BoxBlue2.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */; };
|
||||
3518E5240AC62A2B002ED3A2 /* BoxBlue1.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E4CF0AC62517002ED3A2 /* BoxBlue1.tiff */; };
|
||||
3518E52B0AC62A57002ED3A2 /* BoxWhite.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E5280AC62A55002ED3A2 /* BoxWhite.tiff */; };
|
||||
3518E52C0AC62A57002ED3A2 /* BoxBlue3.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E5270AC62A55002ED3A2 /* BoxBlue3.tiff */; };
|
||||
3518E57B0AC632EA002ED3A2 /* BoxGreen.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 3518E5760AC63262002ED3A2 /* BoxGreen.tiff */; };
|
||||
35B037B60AC59C4000A10FDF /* Check.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037A60AC59BC600A10FDF /* Check.png */; };
|
||||
35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */; };
|
||||
35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */; };
|
||||
|
@ -195,7 +188,6 @@
|
|||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
A25FCDDF0A37695F002BCBBE /* PauseSelected.png in CopyFiles */,
|
||||
3518E4D40AC62517002ED3A2 /* BoxBlue2.tiff in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -228,12 +220,6 @@
|
|||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
32CA4F630368D1EE00C91783 /* Transmission_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Transmission_Prefix.pch; path = macosx/Transmission_Prefix.pch; sourceTree = "<group>"; };
|
||||
3518E4CD0AC62517002ED3A2 /* PiecesBack.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = PiecesBack.tiff; path = macosx/Images/PiecesBack.tiff; sourceTree = "<group>"; };
|
||||
3518E4CF0AC62517002ED3A2 /* BoxBlue1.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxBlue1.tiff; path = macosx/Images/BoxBlue1.tiff; sourceTree = "<group>"; };
|
||||
3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxBlue2.tiff; path = macosx/Images/BoxBlue2.tiff; sourceTree = "<group>"; };
|
||||
3518E5270AC62A55002ED3A2 /* BoxBlue3.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxBlue3.tiff; path = macosx/Images/BoxBlue3.tiff; sourceTree = "<group>"; };
|
||||
3518E5280AC62A55002ED3A2 /* BoxWhite.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxWhite.tiff; path = macosx/Images/BoxWhite.tiff; sourceTree = "<group>"; };
|
||||
3518E5760AC63262002ED3A2 /* BoxGreen.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = BoxGreen.tiff; path = macosx/Images/BoxGreen.tiff; sourceTree = "<group>"; };
|
||||
35B037A60AC59BC600A10FDF /* Check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Check.png; path = macosx/Images/Check.png; sourceTree = "<group>"; };
|
||||
35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOn.png; path = macosx/Images/ResumeNoWaitOn.png; sourceTree = "<group>"; };
|
||||
35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOff.png; path = macosx/Images/ResumeNoWaitOff.png; sourceTree = "<group>"; };
|
||||
|
@ -502,12 +488,6 @@
|
|||
children = (
|
||||
A259316A0A73B2CC002F4FE7 /* Transmission Help */,
|
||||
A2F8951E0A2D4BA500ED2127 /* Credits.rtf */,
|
||||
3518E4CD0AC62517002ED3A2 /* PiecesBack.tiff */,
|
||||
3518E4CF0AC62517002ED3A2 /* BoxBlue1.tiff */,
|
||||
3518E4D00AC62517002ED3A2 /* BoxBlue2.tiff */,
|
||||
3518E5270AC62A55002ED3A2 /* BoxBlue3.tiff */,
|
||||
3518E5280AC62A55002ED3A2 /* BoxWhite.tiff */,
|
||||
3518E5760AC63262002ED3A2 /* BoxGreen.tiff */,
|
||||
A2305AA40A3DCCEF00AB2D77 /* ProgressBarEndAdvanced.png */,
|
||||
A2305AA50A3DCCEF00AB2D77 /* ProgressBarEndBlue.png */,
|
||||
A2305AA60A3DCCEF00AB2D77 /* ProgressBarEndWhite.png */,
|
||||
|
@ -862,12 +842,6 @@
|
|||
35B037B60AC59C4000A10FDF /* Check.png in Resources */,
|
||||
35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */,
|
||||
35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */,
|
||||
3518E5210AC62A29002ED3A2 /* PiecesBack.tiff in Resources */,
|
||||
3518E5230AC62A2A002ED3A2 /* BoxBlue2.tiff in Resources */,
|
||||
3518E5240AC62A2B002ED3A2 /* BoxBlue1.tiff in Resources */,
|
||||
3518E52B0AC62A57002ED3A2 /* BoxWhite.tiff in Resources */,
|
||||
3518E52C0AC62A57002ED3A2 /* BoxBlue3.tiff in Resources */,
|
||||
3518E57B0AC632EA002ED3A2 /* BoxGreen.tiff in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -25,36 +25,68 @@
|
|||
int i;
|
||||
for (i = 0; i < numPieces; i++)
|
||||
fPieces[i] = BLANK;
|
||||
|
||||
fBack = [NSImage imageNamed: @"PiecesBack.tiff"];
|
||||
NSSize size = [fBack size];
|
||||
|
||||
fWhitePiece = [NSImage imageNamed: @"BoxWhite.tiff"];
|
||||
[fWhitePiece setScalesWhenResized: YES];
|
||||
[fWhitePiece setSize: size];
|
||||
|
||||
fGreenPiece = [NSImage imageNamed: @"BoxGreen.tiff"];
|
||||
[fGreenPiece setScalesWhenResized: YES];
|
||||
[fGreenPiece setSize: size];
|
||||
|
||||
fBlue1Piece = [NSImage imageNamed: @"BoxBlue1.tiff"];
|
||||
[fBlue1Piece setScalesWhenResized: YES];
|
||||
[fBlue1Piece setSize: size];
|
||||
|
||||
fBlue2Piece = [NSImage imageNamed: @"BoxBlue2.tiff"];
|
||||
[fBlue2Piece setScalesWhenResized: YES];
|
||||
[fBlue2Piece setSize: size];
|
||||
|
||||
fBlue3Piece = [NSImage imageNamed: @"BoxBlue3.tiff"];
|
||||
[fBlue3Piece setScalesWhenResized: YES];
|
||||
[fBlue3Piece setSize: size];
|
||||
|
||||
[self setTorrent: nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
NSSize size = [fImageView frame].size;
|
||||
NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [fImageView bounds]];
|
||||
|
||||
//back image
|
||||
fBack = [[NSImage alloc] initWithSize: size];
|
||||
|
||||
[fBack lockFocus];
|
||||
[[NSColor blackColor] set];
|
||||
[bp fill];
|
||||
[fBack unlockFocus];
|
||||
|
||||
//white box image
|
||||
fWhitePiece = [[NSImage alloc] initWithSize: size];
|
||||
|
||||
[fWhitePiece lockFocus];
|
||||
[[NSColor whiteColor] set];
|
||||
[bp fill];
|
||||
[fWhitePiece unlockFocus];
|
||||
|
||||
//green box image
|
||||
fGreenPiece = [[NSImage alloc] initWithSize: size];
|
||||
|
||||
[fGreenPiece lockFocus];
|
||||
[[NSColor colorWithCalibratedRed: 0.557 green: 0.992 blue: 0.639 alpha: 1.0] set];
|
||||
[bp fill];
|
||||
[fGreenPiece unlockFocus];
|
||||
|
||||
//blue 1 box image
|
||||
fBlue1Piece = [[NSImage alloc] initWithSize: size];
|
||||
|
||||
[fBlue1Piece lockFocus];
|
||||
[[NSColor colorWithCalibratedRed: 0.777 green: 0.906 blue: 1.0 alpha: 1.0] set];
|
||||
[bp fill];
|
||||
[fBlue1Piece unlockFocus];
|
||||
|
||||
//blue 2 box image
|
||||
fBlue2Piece = [[NSImage alloc] initWithSize: size];
|
||||
|
||||
[fBlue2Piece lockFocus];
|
||||
[[NSColor colorWithCalibratedRed: 0.682 green: 0.839 blue: 1.0 alpha: 1.0] set];
|
||||
[bp fill];
|
||||
[fBlue2Piece unlockFocus];
|
||||
|
||||
//blue 3 box image
|
||||
fBlue3Piece = [[NSImage alloc] initWithSize: size];
|
||||
|
||||
[fBlue3Piece lockFocus];
|
||||
[[NSColor colorWithCalibratedRed: 0.506 green: 0.745 blue: 1.0 alpha: 1.0] set];
|
||||
[bp fill];
|
||||
[fBlue3Piece unlockFocus];
|
||||
|
||||
//actually draw the box
|
||||
[self setTorrent: nil];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
free(fPieces);
|
||||
|
|
Loading…
Add table
Reference in a new issue