Changeset 9744
- Timestamp:
- Dec 13, 2009, 9:42:45 PM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r9667 r9744 255 255 - (NSRect) sizedWindowFrame; 256 256 257 - (void) resizeFilterBar; 258 257 259 - (void) updateForExpandCollape; 258 260 -
trunk/macosx/Controller.m
r9722 r9744 565 565 [self applyFilter: nil]; 566 566 567 [fWindow makeKeyAndOrderFront: nil]; 567 [fWindow makeKeyAndOrderFront: nil]; 568 569 //can't be done earlier 570 if (![fFilterBar isHidden]) 571 [self resizeFilterBar]; 568 572 569 573 if ([fDefaults boolForKey: @"InfoVisible"]) … … 4091 4095 } 4092 4096 4093 - (void) updateForExpandCollape 4094 { 4095 [self setWindowSizeToFit]; 4096 [self setBottomCountText: YES]; 4097 } 4098 4099 - (void) showMainWindow: (id) sender 4100 { 4101 [fWindow makeKeyAndOrderFront: nil]; 4102 } 4103 4104 - (void) windowDidBecomeMain: (NSNotification *) notification 4105 { 4106 [fBadger clearCompleted]; 4107 [self updateUI]; 4108 } 4109 4110 - (NSSize) windowWillResize: (NSWindow *) sender toSize: (NSSize) proposedFrameSize 4111 { 4112 //only resize horizontally if autosize is enabled 4113 if ([fDefaults boolForKey: @"AutoSize"]) 4114 proposedFrameSize.height = [fWindow frame].size.height; 4115 return proposedFrameSize; 4116 } 4117 4118 - (void) windowDidResize: (NSNotification *) notification 4119 { 4120 if (![fStatusBar isHidden]) 4121 [self resizeStatusButton]; 4122 4123 if ([fFilterBar isHidden]) 4124 return; 4125 4097 - (void) resizeFilterBar 4098 { 4126 4099 //replace all buttons 4127 4100 [fNoFilterButton sizeToFit]; … … 4182 4155 } 4183 4156 4157 - (void) updateForExpandCollape 4158 { 4159 [self setWindowSizeToFit]; 4160 [self setBottomCountText: YES]; 4161 } 4162 4163 - (void) showMainWindow: (id) sender 4164 { 4165 [fWindow makeKeyAndOrderFront: nil]; 4166 } 4167 4168 - (void) windowDidBecomeMain: (NSNotification *) notification 4169 { 4170 [fBadger clearCompleted]; 4171 [self updateUI]; 4172 } 4173 4174 - (NSSize) windowWillResize: (NSWindow *) sender toSize: (NSSize) proposedFrameSize 4175 { 4176 //only resize horizontally if autosize is enabled 4177 if ([fDefaults boolForKey: @"AutoSize"]) 4178 proposedFrameSize.height = [fWindow frame].size.height; 4179 return proposedFrameSize; 4180 } 4181 4182 - (void) windowDidResize: (NSNotification *) notification 4183 { 4184 if (![fStatusBar isHidden]) 4185 [self resizeStatusButton]; 4186 4187 if ([fFilterBar isHidden]) 4188 return; 4189 4190 [self resizeFilterBar]; 4191 } 4192 4184 4193 - (void) applicationWillUnhide: (NSNotification *) notification 4185 4194 { -
trunk/macosx/TorrentCell.m
r9737 r9744 70 70 71 71 - (NSRect) rectForMinimalStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds; 72 - (NSRect) rectForTitleWithStringBasedOnMinimalStatusRect: (NSRect) statusRect 73 inBounds: (NSRect) bounds; 72 - (NSRect) rectForTitleWithStringBasedOnMinimalStatusRect: (NSRect) statusRect inBounds: (NSRect) bounds; 74 73 - (NSRect) rectForProgressWithStringInBounds: (NSRect) bounds; 75 74 - (NSRect) rectForStatusWithStringInBounds: (NSRect) bounds; … … 623 622 } 624 623 625 - (NSRect) rectForTitleWithStringBasedOnMinimalStatusRect: (NSRect) statusRect 626 inBounds: (NSRect) bounds 624 - (NSRect) rectForTitleWithStringBasedOnMinimalStatusRect: (NSRect) statusRect inBounds: (NSRect) bounds 627 625 { 628 626 const BOOL minimal = [fDefaults boolForKey: @"SmallView"]; … … 634 632 635 633 result.size.height = HEIGHT_TITLE; 636 result.size.width = NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL 637 - (minimal ? PADDING_BETWEEN_TITLE_AND_MIN_STATUS + NSWidth(statusRect) : 0.0) 638 - ([[self representedObject] priority] != TR_PRI_NORMAL ? PRIORITY_ICON_WIDTH + PADDING_BETWEEN_TITLE_AND_PRIORITY: 0.0); 634 result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL; 635 if (minimal) 636 result.size.width -= PADDING_BETWEEN_TITLE_AND_MIN_STATUS + NSWidth(statusRect); 637 if ([[self representedObject] priority] != TR_PRI_NORMAL) 638 result.size.width -= PRIORITY_ICON_WIDTH + PADDING_BETWEEN_TITLE_AND_PRIORITY; 639 639 640 640 return result; … … 670 670 const BOOL minimal = [fDefaults boolForKey: @"SmallView"]; 671 671 672 NSRect result = bounds;672 NSRect result; 673 673 result.size.height = BAR_HEIGHT; 674 result.origin.x +=(minimal ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG) + PADDING_BETWEEN_IMAGE_AND_BAR;675 676 result.origin.y +=PADDING_ABOVE_TITLE + HEIGHT_TITLE;674 result.origin.x = NSMinX(bounds) + (minimal ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG) + PADDING_BETWEEN_IMAGE_AND_BAR; 675 676 result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE; 677 677 if (minimal) 678 678 result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN; … … 687 687 - (NSRect) controlButtonRectForBounds: (NSRect) bounds 688 688 { 689 NSRect result = bounds;689 NSRect result; 690 690 result.size.height = NORMAL_BUTTON_WIDTH; 691 691 result.size.width = NORMAL_BUTTON_WIDTH; 692 692 result.origin.x = NSMaxX(bounds) - 2.0f * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH); 693 693 694 result.origin.y +=PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;694 result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f; 695 695 if ([fDefaults boolForKey: @"SmallView"]) 696 696 result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN; … … 703 703 - (NSRect) revealButtonRectForBounds: (NSRect) bounds 704 704 { 705 NSRect result = bounds;705 NSRect result; 706 706 result.size.height = NORMAL_BUTTON_WIDTH; 707 707 result.size.width = NORMAL_BUTTON_WIDTH; 708 708 result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH); 709 709 710 result.origin.y +=PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;710 result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f; 711 711 if ([fDefaults boolForKey: @"SmallView"]) 712 712 result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
Note: See TracChangeset
for help on using the changeset viewer.