mirror of
https://github.com/transmission/transmission
synced 2025-02-12 17:34:40 +00:00
feat: place upload above download in macOS badge (#4055)
This commit is contained in:
parent
cb932ddf8d
commit
c32161f7ca
1 changed files with 11 additions and 11 deletions
|
@ -54,19 +54,19 @@ static CGFloat const kBetweenPadding = 2.0;
|
|||
BOOL const upload = self.fUploadRate >= 0.1;
|
||||
BOOL const download = self.fDownloadRate >= 0.1;
|
||||
CGFloat bottom = 0.0;
|
||||
if (download)
|
||||
{
|
||||
NSImage* downloadBadge = [NSImage imageNamed:@"DownloadBadge"];
|
||||
[self badge:downloadBadge string:[NSString stringForSpeedAbbrev:self.fDownloadRate] atHeight:bottom];
|
||||
|
||||
if (upload)
|
||||
{
|
||||
NSImage* uploadBadge = [NSImage imageNamed:@"UploadBadge"];
|
||||
[self badge:uploadBadge string:[NSString stringForSpeedAbbrev:self.fUploadRate] atHeight:bottom];
|
||||
|
||||
if (download)
|
||||
{
|
||||
bottom += uploadBadge.size.height + kBetweenPadding; //download rate above upload rate
|
||||
bottom += downloadBadge.size.height + kBetweenPadding; //upload rate above download rate
|
||||
}
|
||||
}
|
||||
if (download)
|
||||
if (upload)
|
||||
{
|
||||
[self badge:[NSImage imageNamed:@"DownloadBadge"] string:[NSString stringForSpeedAbbrev:self.fDownloadRate] atHeight:bottom];
|
||||
[self badge:[NSImage imageNamed:@"UploadBadge"] string:[NSString stringForSpeedAbbrev:self.fUploadRate] atHeight:bottom];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue