-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathSPExportTaskWindow.m
More file actions
58 lines (43 loc) · 1.91 KB
/
Copy pathSPExportTaskWindow.m
File metadata and controls
58 lines (43 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#import "SPExportTaskWindow.h"
#import "SPExporter.h"
@implementation SPExportTaskWindow
// ----------------------------------------------------------------------------
- (void) awakeFromNib
// ----------------------------------------------------------------------------
{
collectionView.maxNumberOfColumns = 1;
collectionView.maxNumberOfRows = 32768;
collectionView.backgroundColors = [NSColor controlAlternatingRowBackgroundColors];
NSScrollView* scrollView = collectionView.enclosingScrollView;
NSSize contentSize = scrollView.contentSize;
const float minHeight = 54.0f;
float width = contentSize.width;
collectionView.maxItemSize = NSMakeSize(width, minHeight);
collectionView.minItemSize = NSMakeSize(width, minHeight);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidResize:)
name:NSWindowDidResizeNotification
object:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidResize:)
name:NSSystemColorsDidChangeNotification
object:self];
}
// ----------------------------------------------------------------------------
- (void)systemColorsDidChange:(NSNotification *)aNotification
// ----------------------------------------------------------------------------
{
collectionView.backgroundColors = [NSColor controlAlternatingRowBackgroundColors];
}
// ----------------------------------------------------------------------------
- (void)windowDidResize:(NSNotification *)aNotification
// ----------------------------------------------------------------------------
{
NSScrollView* scrollView = collectionView.enclosingScrollView;
NSSize contentSize = scrollView.contentSize;
const float minHeight = 54.0f;
float width = contentSize.width;
collectionView.maxItemSize = NSMakeSize(width, minHeight);
collectionView.minItemSize = NSMakeSize(width, minHeight);
}
@end