Changeset 7758
- Timestamp:
- Jan 19, 2009, 10:28:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5x/macosx/Controller.m
r7756 r7758 4081 4081 //calculate width the buttons can take up 4082 4082 const CGFloat allowedWidth = (searchFrame.origin.x - 5.0) - allRect.origin.x; 4083 4084 const CGFloat currentTotal = NSWidth(allRect) + NSWidth(activeRect) + NSWidth(downloadRect) + NSWidth(seedRect)4085 + NSWidth(pauseRect);4083 const CGFloat currentWidth = NSWidth(allRect) + NSWidth(activeRect) + NSWidth(downloadRect) + NSWidth(seedRect) 4084 + NSWidth(pauseRect) + 4.0; //add 4 for space between buttons 4085 const CGFloat ratio = allowedWidth / currentWidth; 4086 4086 4087 4087 //decrease button widths proportionally 4088 allRect.size.width = NSWidth(allRect) * (allowedWidth / currentTotal);4089 activeRect.size.width = NSWidth(activeRect) * (allowedWidth / currentTotal);4090 downloadRect.size.width = NSWidth(downloadRect) * (allowedWidth / currentTotal);4091 seedRect.size.width = NSWidth(seedRect) * (allowedWidth / currentTotal);4092 pauseRect.size.width = NSWidth(pauseRect) * (allowedWidth / currentTotal);4088 allRect.size.width = NSWidth(allRect) * ratio; 4089 activeRect.size.width = NSWidth(activeRect) * ratio; 4090 downloadRect.size.width = NSWidth(downloadRect) * ratio; 4091 seedRect.size.width = NSWidth(seedRect) * ratio; 4092 pauseRect.size.width = NSWidth(pauseRect) * ratio; 4093 4093 } 4094 4094 else;
Note: See TracChangeset
for help on using the changeset viewer.