mirror of
https://github.com/transmission/transmission
synced 2024-12-23 08:13:27 +00:00
the PiecesView will use target/action instead of notification center for mouse-down events
This commit is contained in:
parent
92db464093
commit
90b042f789
2 changed files with 5 additions and 3 deletions
|
@ -55,8 +55,6 @@
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updatePiecesView) name: @"UpdatePiecesView" object: nil];
|
|
||||||
|
|
||||||
[fTransferSectionLabel sizeToFit];
|
[fTransferSectionLabel sizeToFit];
|
||||||
[fDatesSectionLabel sizeToFit];
|
[fDatesSectionLabel sizeToFit];
|
||||||
[fTimeSectionLabel sizeToFit];
|
[fTimeSectionLabel sizeToFit];
|
||||||
|
@ -95,6 +93,10 @@
|
||||||
frame.size.width -= widthIncrease;
|
frame.size.width -= widthIncrease;
|
||||||
[field setFrame: frame];
|
[field setFrame: frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set the click action of the pieces view
|
||||||
|
[fPiecesView setAction:@selector(updatePiecesView)];
|
||||||
|
[fPiecesView setTarget:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
|
@ -216,7 +216,7 @@ enum
|
||||||
const BOOL availability = ![[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"];
|
const BOOL availability = ![[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"];
|
||||||
[[NSUserDefaults standardUserDefaults] setBool: availability forKey: @"PiecesViewShowAvailability"];
|
[[NSUserDefaults standardUserDefaults] setBool: availability forKey: @"PiecesViewShowAvailability"];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdatePiecesView" object: self];
|
[self sendAction:[self action] to:[self target]];
|
||||||
}
|
}
|
||||||
|
|
||||||
[super mouseDown: event];
|
[super mouseDown: event];
|
||||||
|
|
Loading…
Reference in a new issue