when the main window isn't the key window, make the status bar show the normal window background

This commit is contained in:
Mitchell Livingston 2007-09-23 16:21:03 +00:00
parent b3fde0b43b
commit 4227d425f1
9 changed files with 107 additions and 14 deletions

View File

@ -75,6 +75,8 @@
A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */; };
A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FA40C4D97840034AB1D /* PriorityNone.png */; };
A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */; };
A21282A70CA6C66800EAEE0F /* StatusBarView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A21282A50CA6C66800EAEE0F /* StatusBarView.h */; };
A21282A80CA6C66800EAEE0F /* StatusBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = A21282A60CA6C66800EAEE0F /* StatusBarView.m */; };
A21567ED0A9A5034004DECD6 /* MessageWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = A21567EB0A9A5034004DECD6 /* MessageWindow.nib */; };
A215760B0C0D449A0057A26A /* NSBezierPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A21576090C0D449A0057A26A /* NSBezierPathAdditions.m */; };
A2173E1C0A33C1B300B0D8AB /* ActionButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */; };
@ -280,6 +282,7 @@
files = (
A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */,
A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */,
A21282A70CA6C66800EAEE0F /* StatusBarView.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -373,6 +376,8 @@
A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityMixed.png; path = macosx/Images/PriorityMixed.png; sourceTree = "<group>"; };
A20B6FA40C4D97840034AB1D /* PriorityNone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNone.png; path = macosx/Images/PriorityNone.png; sourceTree = "<group>"; };
A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNormal.png; path = macosx/Images/PriorityNormal.png; sourceTree = "<group>"; };
A21282A50CA6C66800EAEE0F /* StatusBarView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = StatusBarView.h; path = macosx/StatusBarView.h; sourceTree = "<group>"; };
A21282A60CA6C66800EAEE0F /* StatusBarView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = StatusBarView.m; path = macosx/StatusBarView.m; sourceTree = "<group>"; };
A21576090C0D449A0057A26A /* NSBezierPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSBezierPathAdditions.m; path = macosx/NSBezierPathAdditions.m; sourceTree = "<group>"; };
A215760A0C0D449A0057A26A /* NSBezierPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSBezierPathAdditions.h; path = macosx/NSBezierPathAdditions.h; sourceTree = "<group>"; };
A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionButtonPressed.png; path = macosx/Images/ActionButtonPressed.png; sourceTree = "<group>"; };
@ -711,6 +716,8 @@
E1B6FC000C0D72A00015FE4D /* Overlay Window */,
E138A9720C04D88F00C5426C /* CTGradient */,
E1B6FBEB0C0D70AC0015FE4D /* UKKQueue */,
A21282A50CA6C66800EAEE0F /* StatusBarView.h */,
A21282A60CA6C66800EAEE0F /* StatusBarView.m */,
);
name = Sources;
sourceTree = "<group>";
@ -1479,6 +1486,7 @@
35F373030C2DA89000DAA8F2 /* FilePriorityCell.m in Sources */,
A2085DDC0C53BC74000BC3B7 /* AboutWindowController.m in Sources */,
A234D0D20C79FB3600A82373 /* NSMenuAdditions.m in Sources */,
A21282A80CA6C66800EAEE0F /* StatusBarView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1589,13 +1597,13 @@
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
isa = PBXVariantGroup;
children = (
A2FA34650CA323EA00C432EE /* en */,
A22BC9B10C5C505200F5FB72 /* Korean */,
A22BCA310C5D5CDA00F5FB72 /* Italian */,
A20431130C5EAF490081E5CC /* Russian */,
A22A7EBF0C627FC200E30364 /* Greek */,
A2603A010C6338FB00F5FDFD /* Spanish */,
A2C19EDE0C676F5200E0B235 /* French */,
A2FA34650CA323EA00C432EE /* en */,
);
name = MainMenu.nib;
sourceTree = "<group>";
@ -1603,13 +1611,13 @@
A200B9620A227FD0007BBB1E /* InfoWindow.nib */ = {
isa = PBXVariantGroup;
children = (
A2FA34630CA323EA00C432EE /* en */,
A22BC9AF0C5C505200F5FB72 /* Korean */,
A22BCA2F0C5D5CDA00F5FB72 /* Italian */,
A20431110C5EAF490081E5CC /* Russian */,
A22A7EBD0C627FC200E30364 /* Greek */,
A26039FF0C6338FB00F5FDFD /* Spanish */,
A2C19EDC0C676F5200E0B235 /* French */,
A2FA34630CA323EA00C432EE /* en */,
);
name = InfoWindow.nib;
sourceTree = "<group>";
@ -1617,13 +1625,13 @@
A2085E000C53C16F000BC3B7 /* AboutWindow.nib */ = {
isa = PBXVariantGroup;
children = (
A2FA345C0CA323DC00C432EE /* en */,
A22BC9AD0C5C505200F5FB72 /* Korean */,
A22BCA2D0C5D5CDA00F5FB72 /* Italian */,
A204310F0C5EAF490081E5CC /* Russian */,
A22A7EBB0C627FC200E30364 /* Greek */,
A26039FC0C6338FB00F5FDFD /* Spanish */,
A2C19EDA0C676F5200E0B235 /* French */,
A2FA345C0CA323DC00C432EE /* en */,
);
name = AboutWindow.nib;
sourceTree = "<group>";
@ -1631,13 +1639,13 @@
A21567EB0A9A5034004DECD6 /* MessageWindow.nib */ = {
isa = PBXVariantGroup;
children = (
A2FA34660CA323EA00C432EE /* en */,
A22BC9B20C5C505300F5FB72 /* Korean */,
A22BCA320C5D5CDA00F5FB72 /* Italian */,
A20431140C5EAF490081E5CC /* Russian */,
A22A7EC00C627FC200E30364 /* Greek */,
A2603A020C6338FB00F5FDFD /* Spanish */,
A2C19EDF0C676F5200E0B235 /* French */,
A2FA34660CA323EA00C432EE /* en */,
);
name = MessageWindow.nib;
sourceTree = "<group>";
@ -1659,13 +1667,13 @@
A2912C520A2956E80097A0CA /* PrefsWindow.nib */ = {
isa = PBXVariantGroup;
children = (
A2FA34670CA323EA00C432EE /* en */,
A22BC9B30C5C505300F5FB72 /* Korean */,
A22BCA330C5D5CDA00F5FB72 /* Italian */,
A20431150C5EAF490081E5CC /* Russian */,
A22A7EC10C627FC200E30364 /* Greek */,
A2603A030C6338FB00F5FDFD /* Spanish */,
A2C19EE00C676F5200E0B235 /* French */,
A2FA34670CA323EA00C432EE /* en */,
);
name = PrefsWindow.nib;
sourceTree = "<group>";
@ -1673,13 +1681,13 @@
A2AE68310C628A35008753C9 /* Creator.nib */ = {
isa = PBXVariantGroup;
children = (
A2FA34610CA323EA00C432EE /* en */,
A2AE68360C628A58008753C9 /* Korean */,
A2AE68370C628A5E008753C9 /* Italian */,
A2AE68380C628A63008753C9 /* Russian */,
A2AE68390C628A66008753C9 /* Greek */,
A26039FD0C6338FB00F5FDFD /* Spanish */,
A2C19EDB0C676F5200E0B235 /* French */,
A2FA34610CA323EA00C432EE /* en */,
);
name = Creator.nib;
sourceTree = "<group>";

View File

@ -224,8 +224,6 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
- (void) awakeFromNib
{
[fBottomBar setBackgroundImage: [NSImage imageNamed: @"BottomBorder.png"]];
[fStatusBar setBackgroundImage: [NSImage imageNamed: @"StatusBarBackground.png"]];
[fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"Transmission Toolbar"];
[toolbar setDelegate: self];
@ -3218,9 +3216,16 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
- (void) windowDidBecomeKey: (NSNotification *) notification
{
[fStatusBar setNeedsDisplay: YES];
[fBadger clearCompleted];
}
- (void) windowDidResignKey: (NSNotification *) notification
{
[fStatusBar setNeedsDisplay: YES];
}
- (NSSize) windowWillResize: (NSWindow *) sender toSize: (NSSize) proposedFrameSize
{
//only resize horizontally if autosize is enabled

View File

@ -32,6 +32,8 @@
- (void) awakeFromNib
{
[self setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
[fNoFilterButton setTitle: NSLocalizedString(@"All", @"Filter Bar Button -> title")];
[fDownloadFilterButton setTitle: NSLocalizedString(@"Downloading", @"Filter Bar Button -> title")];
[fSeedFilterButton setTitle: NSLocalizedString(@"Seeding", @"Filter Bar Button -> title")];
@ -46,8 +48,6 @@
[fDownloadFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fNoFilterButton frame]) + PADDING_HORIZONTAL, ORIGIN_VERTICAL)];
[fSeedFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fDownloadFilterButton frame]) + PADDING_HORIZONTAL, ORIGIN_VERTICAL)];
[fPauseFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fSeedFilterButton frame]) + PADDING_HORIZONTAL, ORIGIN_VERTICAL)];
[self setNeedsDisplay: YES];
}
@end

31
macosx/StatusBarView.h Normal file
View File

@ -0,0 +1,31 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2006-2007 Transmission authors and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import "ImageBackgroundView.h"
@interface StatusBarView : ImageBackgroundView
{
}
@end

45
macosx/StatusBarView.m Normal file
View File

@ -0,0 +1,45 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2006-2007 Transmission authors and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#import "StatusBarView.h"
@implementation StatusBarView
- (void) awakeFromNib
{
[self setBackgroundImage: [NSImage imageNamed: @"StatusBarBackground.png"]];
}
- (BOOL) isOpaque
{
return [[self window] isKeyWindow];
}
- (void) drawRect: (NSRect) rect
{
if ([[self window] isKeyWindow])
[super drawRect: rect];
}
@end

View File

@ -280,9 +280,12 @@ static int static_lastid = 0;
if (![self allDownloaded])
{
if ([fDefaults boolForKey: @"DisplayStatusProgressSelected"])
{
uint64_t downloadedValid = [self downloadedValid];
[progressString appendFormat: NSLocalizedString(@"%@ of %@ selected (%.2f%%)", "Torrent -> progress string"),
[NSString stringForFileSize: [self downloadedValid]],
[NSString stringForFileSize: [self downloadedValid] + fStat->left], 100.0 * [self progressDone]];
[NSString stringForFileSize: downloadedValid],
[NSString stringForFileSize: downloadedValid + fStat->left], 100.0 * [self progressDone]];
}
else
[progressString appendFormat: NSLocalizedString(@"%@ of %@ (%.2f%%)", "Torrent -> progress string"),
[NSString stringForFileSize: [self downloadedValid]],

View File

@ -179,6 +179,7 @@
LANGUAGE = ObjC;
SUPERCLASS = NSObject;
},
{CLASS = StatusBarView; LANGUAGE = ObjC; SUPERCLASS = ImageBackgroundView; },
{
ACTIONS = {
checkFile = id;

View File

@ -9,7 +9,7 @@
<key>1041</key>
<string>480 344 208 149 0 0 1680 1028 </string>
<key>1480</key>
<string>630 671 420 63 0 0 1680 1028 </string>
<string>640 533 420 63 0 0 1680 1028 </string>
<key>1603</key>
<string>601 669 477 67 0 0 1680 1028 </string>
<key>1936</key>
@ -35,11 +35,11 @@
<integer>3</integer>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>2043</integer>
<integer>1603</integer>
<integer>21</integer>
<integer>1480</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8R4031</string>

Binary file not shown.