mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
tidy up the filter bar code a little
This commit is contained in:
parent
141404356a
commit
a275204114
2 changed files with 12 additions and 7 deletions
|
@ -24,12 +24,13 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "ImageBackgroundView.h"
|
||||
#import "FilterBarButton.h"
|
||||
|
||||
@class FilterBarButton;
|
||||
|
||||
@interface FilterBarView : ImageBackgroundView
|
||||
{
|
||||
IBOutlet FilterBarButton * fNoFilterButton, * fDownloadFilterButton,
|
||||
* fSeedFilterButton, * fPauseFilterButton;
|
||||
* fSeedFilterButton, * fPauseFilterButton;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#import "FilterBarView.h"
|
||||
#import "FilterBarButton.h"
|
||||
|
||||
#define ORIGIN_VERTICAL 3.0
|
||||
#define ORIGIN_HORIZONTAL 4.0
|
||||
#define PADDING_HORIZONTAL 2.0
|
||||
|
||||
@implementation FilterBarView
|
||||
|
||||
|
@ -38,11 +43,10 @@
|
|||
[fSeedFilterButton sizeToFit];
|
||||
[fPauseFilterButton sizeToFit];
|
||||
|
||||
float padding = 2.0, base = 3.0;
|
||||
[fNoFilterButton setFrameOrigin: NSMakePoint(padding + 2.0, base)];
|
||||
[fDownloadFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fNoFilterButton frame]) + padding, base)];
|
||||
[fSeedFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fDownloadFilterButton frame]) + padding, base)];
|
||||
[fPauseFilterButton setFrameOrigin: NSMakePoint(NSMaxX([fSeedFilterButton frame]) + padding, base)];
|
||||
[fNoFilterButton setFrameOrigin: NSMakePoint(ORIGIN_HORIZONTAL, ORIGIN_VERTICAL)];
|
||||
[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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue