From 4ec8c19bbd203dbe4860370961a721c41fcea0d6 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 6 Oct 2006 20:10:15 +0000 Subject: [PATCH] In the pieces view, pieces will briefly turn red before becoming green. --- macosx/InfoWindowController.m | 2 +- macosx/PiecesView.h | 2 +- macosx/PiecesView.m | 24 +++++++++++++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index f7fcae06a..fc1101a7b 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -392,7 +392,7 @@ { height = TAB_ACTIVITY_HEIGHT; - [fPiecesView updateView: NO]; + [fPiecesView updateView: YES]; } else if ([identifier isEqualToString: TAB_PEERS_IDENT]) { diff --git a/macosx/PiecesView.h b/macosx/PiecesView.h index c20ce84bd..5e0129526 100644 --- a/macosx/PiecesView.h +++ b/macosx/PiecesView.h @@ -29,7 +29,7 @@ { int8_t * fPieces; - NSImage * fBack, * fWhitePiece, * fGreenPiece, + NSImage * fBack, * fWhitePiece, * fGreenPiece, * fRedPiece, * fBlue1Piece, * fBlue2Piece, * fBlue3Piece; Torrent * fTorrent; diff --git a/macosx/PiecesView.m b/macosx/PiecesView.m index f9248727f..9e154f3cf 100644 --- a/macosx/PiecesView.m +++ b/macosx/PiecesView.m @@ -70,11 +70,19 @@ [bp fill]; [fGreenPiece unlockFocus]; + //green box image + fRedPiece = [[NSImage alloc] initWithSize: size]; + + [fRedPiece lockFocus]; + [[NSColor redColor] set]; + [bp fill]; + [fRedPiece 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]; + [[NSColor colorWithCalibratedRed: 0.682 green: 0.839 blue: 1.0 alpha: 1.0] set]; [bp fill]; [fBlue1Piece unlockFocus]; @@ -82,7 +90,7 @@ fBlue2Piece = [[NSImage alloc] initWithSize: size]; [fBlue2Piece lockFocus]; - [[NSColor colorWithCalibratedRed: 0.682 green: 0.839 blue: 1.0 alpha: 1.0] set]; + [[NSColor colorWithCalibratedRed: 0.506 green: 0.745 blue: 1.0 alpha: 1.0] set]; [bp fill]; [fBlue2Piece unlockFocus]; @@ -90,7 +98,7 @@ fBlue3Piece = [[NSImage alloc] initWithSize: size]; [fBlue3Piece lockFocus]; - [[NSColor colorWithCalibratedRed: 0.506 green: 0.745 blue: 1.0 alpha: 1.0] set]; + [[NSColor colorWithCalibratedRed: 0.35 green: 0.65 blue: 1.0 alpha: 1.0] set]; [bp fill]; [fBlue3Piece unlockFocus]; @@ -104,6 +112,7 @@ [fBack release]; [fWhitePiece release]; + [fRedPiece release]; [fGreenPiece release]; [fBlue1Piece release]; [fBlue2Piece release]; @@ -181,15 +190,20 @@ } pieceImage = nil; - piece = pieces[index]; if (piece < 0) { - if (first || fPieces[index] != -1) + if (first || fPieces[index] == -2) { fPieces[index] = -1; pieceImage = fGreenPiece; } + else if (fPieces[index] != -1) + { + fPieces[index] = -2; + pieceImage = fRedPiece; + } + else; } else if (piece == 0) {