resize the status button if it is too large (typically this is for localizations)
This commit is contained in:
parent
183b77ab27
commit
6484f685b4
|
@ -77,6 +77,7 @@ typedef enum
|
|||
IBOutlet MenuLabel * fStatusTigerField;
|
||||
IBOutlet NSImageView * fStatusTigerImageView;
|
||||
IBOutlet NSTextField * fTotalDLField, * fTotalULField;
|
||||
IBOutlet NSImageView * fTotalDLImageView;
|
||||
|
||||
IBOutlet StatusBarView * fFilterBar;
|
||||
IBOutlet FilterButton * fNoFilterButton, * fActiveFilterButton, * fDownloadFilterButton,
|
||||
|
@ -183,6 +184,7 @@ typedef enum
|
|||
|
||||
- (void) updateUI;
|
||||
|
||||
- (void) resizeStatusButton;
|
||||
- (void) setBottomCountText: (BOOL) filtering;
|
||||
|
||||
- (void) updateTorrentsInQueue;
|
||||
|
|
|
@ -1448,12 +1448,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
if ([NSApp isOnLeopardOrBetter])
|
||||
{
|
||||
[fStatusButton setTitle: statusString];
|
||||
[fStatusButton sizeToFit];
|
||||
|
||||
//width ends up being too long
|
||||
NSRect statusFrame = [fStatusButton frame];
|
||||
statusFrame.size.width -= 25.0;
|
||||
[fStatusButton setFrame: statusFrame];
|
||||
[self resizeStatusButton];
|
||||
}
|
||||
else
|
||||
[fStatusTigerField setStringValue: statusString];
|
||||
|
@ -1469,6 +1464,21 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
[fBadger updateBadge];
|
||||
}
|
||||
|
||||
- (void) resizeStatusButton
|
||||
{
|
||||
[fStatusButton sizeToFit];
|
||||
|
||||
//width ends up being too long
|
||||
NSRect statusFrame = [fStatusButton frame];
|
||||
statusFrame.size.width -= 25.0;
|
||||
|
||||
float difference = NSMaxX(statusFrame) + 5.0 - [fTotalDLImageView frame].origin.x;
|
||||
if (difference > 0)
|
||||
statusFrame.size.width -= difference;
|
||||
|
||||
[fStatusButton setFrame: statusFrame];
|
||||
}
|
||||
|
||||
- (void) setBottomCountText: (BOOL) filtering
|
||||
{
|
||||
NSString * totalTorrentsString;
|
||||
|
@ -3828,6 +3838,9 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
|
||||
- (void) windowDidResize: (NSNotification *) notification
|
||||
{
|
||||
if (![fStatusBar isHidden])
|
||||
[self resizeStatusButton];
|
||||
|
||||
if ([fFilterBar isHidden])
|
||||
return;
|
||||
|
||||
|
@ -3875,14 +3888,14 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
|
||||
activeRect.size.width -= active;
|
||||
|
||||
downloadRect.size.width -= download;
|
||||
downloadRect.origin.x -= active;
|
||||
downloadRect.size.width -= download;
|
||||
|
||||
seedRect.size.width -= seed;
|
||||
seedRect.origin.x -= active + download;
|
||||
seedRect.size.width -= seed;
|
||||
|
||||
pauseRect.size.width -= paused;
|
||||
pauseRect.origin.x -= active + download + seed;
|
||||
pauseRect.size.width -= paused;
|
||||
}
|
||||
else;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue