treat the entire file icon as the action button

This commit is contained in:
Mitchell Livingston 2008-01-20 18:51:53 +00:00
parent bf146526bf
commit 30cee125da
6 changed files with 10 additions and 68 deletions

View File

@ -134,7 +134,6 @@
A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75950CB6AB4800226674 /* InfoGeneral.png */; };
A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2710E750A86796000CE4F7D /* PrefsWindow.m */; };
A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */ = {isa = PBXBuildFile; fileRef = A277DA090C693D9C00DA2CD4 /* ActionOn.png */; };
A277DA0C0C693D9C00DA2CD4 /* ActionOff.png in Resources */ = {isa = PBXBuildFile; fileRef = A277DA0A0C693D9C00DA2CD4 /* ActionOff.png */; };
A29576030D11D63C0093B167 /* Creator.xib in Resources */ = {isa = PBXBuildFile; fileRef = A29576010D11D63C0093B167 /* Creator.xib */; };
A29576080D11D70E0093B167 /* MessageWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A29576060D11D70E0093B167 /* MessageWindow.xib */; };
A29576130D11D8DD0093B167 /* InfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A29576110D11D8DD0093B167 /* InfoWindow.xib */; };
@ -543,7 +542,6 @@
A27476FF0CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A27477010CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/Localizable.strings; sourceTree = "<group>"; };
A277DA090C693D9C00DA2CD4 /* ActionOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionOn.png; path = macosx/Images/ActionOn.png; sourceTree = "<group>"; };
A277DA0A0C693D9C00DA2CD4 /* ActionOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionOff.png; path = macosx/Images/ActionOff.png; sourceTree = "<group>"; };
A28E1DDF0CFFD8EC00E16385 /* ButtonToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ButtonToolbarItem.h; path = macosx/ButtonToolbarItem.h; sourceTree = "<group>"; };
A29576020D11D63C0093B167 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = macosx/English.lproj/Creator.xib; sourceTree = "<group>"; };
A29576070D11D70E0093B167 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = macosx/English.lproj/MessageWindow.xib; sourceTree = "<group>"; };
@ -944,7 +942,6 @@
A22D3AA40D00D1790079CFED /* TurtleBlue.png */,
A2F41DA80D0B9152006CE378 /* ActionGear.png */,
A277DA090C693D9C00DA2CD4 /* ActionOn.png */,
A277DA0A0C693D9C00DA2CD4 /* ActionOff.png */,
A2623B4D0D3DC6DF0045D19A /* ActionHover.png */,
35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */,
35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */,
@ -1602,7 +1599,6 @@
A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */,
A2085E3F0C53C949000BC3B7 /* LICENSE in Resources */,
A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */,
A277DA0C0C693D9C00DA2CD4 /* ActionOff.png in Resources */,
A261A8260C6A0D68003BAFDA /* Error.png in Resources */,
A2EF7DEC0C96297400FA9811 /* PurpleDot.png in Resources */,
A24872B60C9B6BB9000F5B92 /* Advanced.png in Resources */,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

View File

@ -32,7 +32,7 @@
NSMutableDictionary * fTitleAttributes, * fStatusAttributes;
BOOL fTracking, fMouseDownControlButton, fMouseDownRevealButton, fMouseDownActionButton,
fHoverControl, fHoverReveal, fHoverAction, fHoverActionIcon;
fHoverControl, fHoverReveal, fHoverAction;
NSColor * fBarOverlayColor;
CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient,
@ -60,7 +60,6 @@
- (void) setControlHover: (BOOL) hover;
- (void) setRevealHover: (BOOL) hover;
- (void) setActionHover: (BOOL) hover;
- (void) setActionIconHover: (BOOL) hover;
- (void) setActionPushed: (BOOL) pushed;
@end

View File

@ -378,7 +378,7 @@
[area release];
//action button
NSRect actionButtonRect = [self actionButtonRectForBounds: cellFrame];
NSRect actionButtonRect = [self iconRectForBounds: cellFrame]; //use the whole icon
NSTrackingAreaOptions actionOptions = options;
if (NSMouseInRect(mouseLocation, actionButtonRect, [controlView isFlipped]))
{
@ -392,26 +392,6 @@
[controlView addTrackingArea: area];
[actionInfo release];
[area release];
//action button (over icon)
if (![fDefaults boolForKey: @"SmallView"])
{
NSRect actionIconButtonRect = [self iconRectForBounds: cellFrame];
NSTrackingAreaOptions actionIconOptions = options;
if (NSMouseInRect(mouseLocation, actionIconButtonRect, [controlView isFlipped]))
{
actionIconOptions |= NSTrackingAssumeInside;
[(TorrentTableView *)controlView setActionIconButtonHover: [[userInfo objectForKey: @"Row"] intValue]];
}
NSMutableDictionary * actionIconInfo = [userInfo mutableCopy];
[actionIconInfo setObject: @"Icon" forKey: @"Type"];
area = [[NSTrackingArea alloc] initWithRect: actionIconButtonRect options: actionIconOptions owner: controlView
userInfo: actionIconInfo];
[controlView addTrackingArea: area];
[actionIconInfo release];
[area release];
}
}
- (void) setControlHover: (BOOL) hover
@ -429,11 +409,6 @@
fHoverAction = [NSApp isOnLeopardOrBetter] ? hover : NO;
}
- (void) setActionIconHover: (BOOL) hover
{
fHoverActionIcon = [NSApp isOnLeopardOrBetter] ? hover : NO;
}
- (void) setActionPushed: (BOOL) pushed
{
fMouseDownActionButton = pushed;
@ -572,8 +547,6 @@
actionImageSuffix = @"On.png";
else if (!fTracking && fHoverAction)
actionImageSuffix = @"Hover.png";
else if (!fTracking && fHoverActionIcon)
actionImageSuffix = @"Off.png";
else
actionImageSuffix = nil;

View File

@ -37,7 +37,7 @@
IBOutlet NSMenu * fContextRow, * fContextNoRow;
int fMouseControlRow, fMouseRevealRow, fMouseActionRow, fMouseActionIconRow, fActionPushedRow;
int fMouseControlRow, fMouseRevealRow, fMouseActionRow, fActionPushedRow;
NSArray * fSelectedTorrents;
NSMutableArray * fKeyStrokes;
@ -55,7 +55,6 @@
- (void) setControlButtonHover: (int) row;
- (void) setRevealButtonHover: (int) row;
- (void) setActionButtonHover: (int) row;
- (void) setActionIconButtonHover: (int) row;
- (void) selectTorrents: (NSArray *) torrents;

View File

@ -42,7 +42,6 @@
- (BOOL) pointInRevealRect: (NSPoint) point;
- (BOOL) pointInActionRect: (NSPoint) point;
- (BOOL) pointInIconRect: (NSPoint) point;
- (BOOL) pointInProgressRect: (NSPoint) point;
- (BOOL) pointInMinimalStatusRect: (NSPoint) point;
- (void) updateFileMenu: (NSMenu *) menu forFiles: (NSArray *) files;
@ -62,7 +61,6 @@
fMouseControlRow = -1;
fMouseRevealRow = -1;
fMouseActionRow = -1;
fMouseActionIconRow = -1;
fActionPushedRow = -1;
[self setDelegate: self];
@ -97,7 +95,6 @@
[cell setControlHover: row == fMouseControlRow];
[cell setRevealHover: row == fMouseRevealRow];
[cell setActionHover: row == fMouseActionRow];
[cell setActionIconHover: row == fMouseActionIconRow];
[cell setActionPushed: row == fActionPushedRow];
}
@ -135,7 +132,6 @@
fMouseControlRow = -1;
fMouseRevealRow = -1;
fMouseActionRow = -1;
fMouseActionIconRow = -1;
if (![NSApp isOnLeopardOrBetter])
return;
@ -170,13 +166,6 @@
[self setNeedsDisplayInRect: [self rectOfRow: row]];
}
- (void) setActionIconButtonHover: (int) row
{
fMouseActionIconRow = row;
if (row >= 0)
[self setNeedsDisplayInRect: [self rectOfRow: row]];
}
- (void) mouseEntered: (NSEvent *) event
{
NSDictionary * dict = (NSDictionary *)[event userData];
@ -185,11 +174,10 @@
if ((row = [dict objectForKey: @"Row"]))
{
int rowVal = [row intValue];
if ([[dict objectForKey: @"Type"] isEqualToString: @"Action"])
NSString * type = [dict objectForKey: @"Type"];
if ([type isEqualToString: @"Action"])
fMouseActionRow = rowVal;
else if ([[dict objectForKey: @"Type"] isEqualToString: @"Icon"])
fMouseActionIconRow = rowVal;
else if ([[dict objectForKey: @"Type"] isEqualToString: @"Control"])
else if ([type isEqualToString: @"Control"])
fMouseControlRow = rowVal;
else
fMouseRevealRow = rowVal;
@ -205,12 +193,10 @@
NSNumber * row;
if ((row = [dict objectForKey: @"Row"]))
{
int rowVal = [row intValue];
if ([[dict objectForKey: @"Type"] isEqualToString: @"Action"])
NSString * type = [dict objectForKey: @"Type"];
if ([type isEqualToString: @"Action"])
fMouseActionRow = -1;
else if ([[dict objectForKey: @"Type"] isEqualToString: @"Icon"])
fMouseActionIconRow = -1;
else if ([[dict objectForKey: @"Type"] isEqualToString: @"Control"])
else if ([type isEqualToString: @"Control"])
fMouseControlRow = -1;
else
fMouseRevealRow = -1;
@ -398,8 +384,7 @@
[fActionMenu appendItemsFromMenu: fileMenu atIndexes: [NSIndexSet indexSetWithIndexesInRange: range] atBottom: YES];
//place menu below button
NSRect rect = [[[self tableColumnWithIdentifier: @"Torrent"] dataCell] actionButtonRectForBounds:
[self frameOfCellAtColumn: 0 row: row]];
NSRect rect = [[[self tableColumnWithIdentifier: @"Torrent"] dataCell] iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]];
NSPoint location = rect.origin;
location.y += rect.size.height + 5.0;
location = [self convertPoint: location toView: nil];
@ -613,16 +598,6 @@
}
- (BOOL) pointInActionRect: (NSPoint) point
{
int row = [self rowAtPoint: point];
if (row < 0)
return NO;
TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
return NSPointInRect(point, [cell actionButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
}
- (BOOL) pointInIconRect: (NSPoint) point
{
int row = [self rowAtPoint: point];
if (row < 0)