Changeset 5273 for trunk/macosx/TorrentTableView.m
- Timestamp:
- Mar 17, 2008, 9:44:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/TorrentTableView.m
r5260 r5273 37 37 #define PIECE_TIME 0.005 38 38 39 #define GROUP_SPEED_IMAGE_COLUMN_WIDTH 8.0 40 #define GROUP_RATIO_IMAGE_COLUMN_WIDTH 10.0 41 39 42 @interface TorrentTableView (Private) 40 43 … … 91 94 fCollapsedGroups = [[NSMutableIndexSet alloc] init]; 92 95 93 //set group columns to show ratio (nib is set to speeds)94 if ([fDefaults boolForKey: @"DisplayGroupRowRatio"])95 [self setGroupStatusColumns];96 97 96 fMouseControlRow = -1; 98 97 fMouseRevealRow = -1; … … 120 119 121 120 [super dealloc]; 121 } 122 123 - (void) awakeFromNib 124 { 125 //set group columns to show ratio, needs to be in awakeFromNib to size columns correctly 126 [self setGroupStatusColumns]; 122 127 } 123 128 … … 818 823 819 824 NSTableColumn * dlTableColumn = [self tableColumnWithIdentifier: @"DL"]; 820 if ([dlTableColumn isHidden] == ratio)821 return;822 825 823 826 [dlTableColumn setHidden: ratio]; 824 827 [[self tableColumnWithIdentifier: @"DL Image"] setHidden: ratio]; 825 828 826 [[self tableColumnWithIdentifier: @"UL Image"] setWidth: ratio ? 10.0 : 8.0]; 827 828 NSTableColumn * groupTableColumn = [self tableColumnWithIdentifier: @"Group"]; 829 [groupTableColumn setWidth: [groupTableColumn width] + (ratio ? -2.0 : 2.0)]; 829 //change size of image column 830 NSTableColumn * ulImageTableColumn = [self tableColumnWithIdentifier: @"UL Image"]; 831 float oldWidth = [ulImageTableColumn width], newWidth = ratio ? GROUP_RATIO_IMAGE_COLUMN_WIDTH : GROUP_SPEED_IMAGE_COLUMN_WIDTH; 832 if (oldWidth != newWidth) 833 { 834 [ulImageTableColumn setWidth: newWidth]; 835 836 NSTableColumn * groupTableColumn = [self tableColumnWithIdentifier: @"Group"]; 837 [groupTableColumn setWidth: [groupTableColumn width] - (newWidth - oldWidth)]; 838 } 830 839 } 831 840
Note: See TracChangeset
for help on using the changeset viewer.