forked from macdonst/callback-mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phonegap_macAppDelegate.m
62 lines (47 loc) · 2.7 KB
/
phonegap_macAppDelegate.m
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
59
60
61
62
//
// phonegap_macAppDelegate.m
// phonegap-mac
//
// Created by shazron on 10-04-08.
// Copyright 2010 Nitobi Software Inc. All rights reserved.
//
#import "phonegap_macAppDelegate.h"
@implementation phonegap_macAppDelegate
@synthesize window, contentView;
- (void) applicationDidStartLaunching:(NSNotification *)aNotification {}
- (void) applicationWillFinishLaunching:(NSNotification *)aNotification
{
[[NSNotificationCenter defaultCenter] addObserver:self.contentView
selector:@selector(windowResized:)
name:NSWindowDidResizeNotification
object:[self window]];
NSURL* fileUrl = [NSURL fileURLWithPath:[[Utils sharedInstance] pathForResource:kStartPage]];
[self.contentView.webView setMainFrameURL:[fileUrl description]];
/* useful colors
NSColor *brown = [NSColor colorWithCalibratedRed:0.184 green:0.180 blue:0.176 alpha:1.000];
NSColor *red = [NSColor colorWithCalibratedRed:0.918 green:0.000 blue:0.000 alpha:1.000];
NSColor *orange = [NSColor colorWithCalibratedRed:0.918 green:0.518 blue:0.000 alpha:1.000];
NSColor *yellow = [NSColor colorWithCalibratedRed:0.918 green:0.914 blue:0.000 alpha:1.000];
NSColor *green = [NSColor colorWithCalibratedRed:0.000 green:0.918 blue:0.106 alpha:1.000];
NSColor *skyBlue = [NSColor colorWithCalibratedRed:0.000 green:0.918 blue:0.906 alpha:1.000];
NSColor *blue = [NSColor colorWithCalibratedRed:0.000 green:0.020 blue:0.918 alpha:1.000];
NSColor *clearColor = [NSColor clearColor];
*/
if (kStartFolder == @"www/phonegap-docs/template/phonegap/") {
NSColor *brown = [NSColor colorWithCalibratedRed:0.184 green:0.180 blue:0.176 alpha:1.000];
[window setBackgroundColor:brown];
[self.contentView.webView setBackgroundColor:brown]; //it ignores "WebView" may not respond to 'setBackGroundColor:' @RandyMcMillan
self.window.backgroundColor = [NSColor colorWithCalibratedRed:0.933 green:0.933 blue:0.933 alpha:1.000];
}else{
NSColor *windowBackGroundColor = [NSColor colorWithCalibratedRed:0.918 green:0.918 blue:0.918 alpha:1.000];
NSColor *webViewBackGroundColor = [NSColor colorWithCalibratedRed:0.082 green:0.133 blue:0.192 alpha:1.000];
[window setBackgroundColor:windowBackGroundColor];
[self.contentView.webView setBackgroundColor:webViewBackGroundColor]; //it ignores "WebView" may not respond to 'setBackGroundColor:' @RandyMcMillan
self.window.backgroundColor = [NSColor colorWithCalibratedRed:0.933 green:0.933 blue:0.933 alpha:1.000];
}//end else
}
- (void) applicationDidFinishLaunching:(NSNotification *)aNotification {
self.contentView.webView.alphaValue = 1.0;
self.contentView.alphaValue = 1.0;
}
@end