mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
Use built-in ability for verifying notifications' objects and update message log a little less often.
This commit is contained in:
parent
6a506622b2
commit
62164414d6
4 changed files with 8 additions and 11 deletions
|
@ -48,10 +48,10 @@
|
||||||
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
[nc addObserver: self selector: @selector(setForActive:)
|
[nc addObserver: self selector: @selector(setForActive:)
|
||||||
name: NSWindowDidBecomeKeyNotification object: nil];
|
name: NSWindowDidBecomeKeyNotification object: [self window]];
|
||||||
|
|
||||||
[nc addObserver: self selector: @selector(setForInactive:)
|
[nc addObserver: self selector: @selector(setForInactive:)
|
||||||
name: NSWindowDidResignKeyNotification object: nil];
|
name: NSWindowDidResignKeyNotification object: [self window]];
|
||||||
|
|
||||||
[nc addObserver: self selector: @selector(resetBounds:)
|
[nc addObserver: self selector: @selector(resetBounds:)
|
||||||
name: NSViewFrameDidChangeNotification object: nil];
|
name: NSViewFrameDidChangeNotification object: nil];
|
||||||
|
@ -252,9 +252,6 @@
|
||||||
|
|
||||||
- (void) setForActive: (NSNotification *) notification
|
- (void) setForActive: (NSNotification *) notification
|
||||||
{
|
{
|
||||||
if ([notification object] != [self window])
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ([self image] == fButtonSelectedDim)
|
if ([self image] == fButtonSelectedDim)
|
||||||
[self setImage: fButtonSelected];
|
[self setImage: fButtonSelected];
|
||||||
else if ([self image] == fButtonNormalDim)
|
else if ([self image] == fButtonNormalDim)
|
||||||
|
@ -266,13 +263,13 @@
|
||||||
|
|
||||||
- (void) setForInactive: (NSNotification *) notification
|
- (void) setForInactive: (NSNotification *) notification
|
||||||
{
|
{
|
||||||
if ([notification object] != [self window])
|
|
||||||
return;
|
|
||||||
|
|
||||||
[self setImage: [self image] == fButtonSelected ? fButtonSelectedDim : fButtonNormalDim];
|
[self setImage: [self image] == fButtonSelected ? fButtonSelectedDim : fButtonNormalDim];
|
||||||
|
|
||||||
if (fTrackingTag)
|
if (fTrackingTag)
|
||||||
|
{
|
||||||
[self removeTrackingRect: fTrackingTag];
|
[self removeTrackingRect: fTrackingTag];
|
||||||
|
fTrackingTag = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
BIN
macosx/English.lproj/PrefsWindow.nib/keyedobjects.nib
generated
BIN
macosx/English.lproj/PrefsWindow.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -29,7 +29,7 @@
|
||||||
#define LEVEL_INFO 1
|
#define LEVEL_INFO 1
|
||||||
#define LEVEL_DEBUG 2
|
#define LEVEL_DEBUG 2
|
||||||
|
|
||||||
#define UPDATE_SECONDS 0.4
|
#define UPDATE_SECONDS 0.6
|
||||||
#define MAX_LINES 1000
|
#define MAX_LINES 1000
|
||||||
|
|
||||||
@interface MessageWindowController (Private)
|
@interface MessageWindowController (Private)
|
||||||
|
|
|
@ -96,7 +96,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
#warning make work
|
#warning should work?
|
||||||
//[fErrorImage release];
|
//[fErrorImage release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
- (void) placeBar: (NSImage *) barImage width: (float) width point: (NSPoint) point
|
- (void) placeBar: (NSImage *) barImage width: (float) width point: (NSPoint) point
|
||||||
{
|
{
|
||||||
if ([barImage size].width < width)
|
if ([barImage size].width < width)
|
||||||
[barImage setSize: NSMakeSize(width * 1.5, BAR_HEIGHT)];
|
[barImage setSize: NSMakeSize(width * 2.0, BAR_HEIGHT)];
|
||||||
|
|
||||||
[barImage compositeToPoint: point fromRect: NSMakeRect(0, 0, width, BAR_HEIGHT) operation: NSCompositeSourceOver];
|
[barImage compositeToPoint: point fromRect: NSMakeRect(0, 0, width, BAR_HEIGHT) operation: NSCompositeSourceOver];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue