forked from veryweblog/ichm
-
Notifications
You must be signed in to change notification settings - Fork 26
/
CHMWebViewController.m
46 lines (37 loc) · 1.14 KB
/
CHMWebViewController.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
//
// CHMWebView.m
// ichm
//
// Created by Robin Lu on 7/29/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "CHMWebViewController.h"
#import <WebKit/WebKit.h>
@implementation CHMWebViewController
@synthesize webView;
@synthesize searchField;
- (id)init {
if ((self = [super initWithNibName:@"CHMWebView" bundle:nil])) {
[self loadView];
}
return self;
}
- (IBAction)hideFindPanel:(id)sender {
if ([findPanel isHidden]) return;
[findPanel setHidden:YES];
CGFloat webViewHeight = [webView frame].size.height;
webViewHeight = webViewHeight + 27;
[webView setFrame:NSMakeRect([webView frame].origin.x, [webView frame].origin.y, [webView frame].size.width, webViewHeight)];
[webView setNeedsDisplay:YES];
}
- (IBAction)showFindPanel:(id)sender {
if ([findPanel isHidden]) {
[findPanel setHidden:NO];
CGFloat webViewHeight = [webView frame].size.height;
webViewHeight = webViewHeight - 27;
[webView setFrame:NSMakeRect([webView frame].origin.x, [webView frame].origin.y, [webView frame].size.width, webViewHeight)];
[webView setNeedsDisplay:YES];
}
[[[self view] window] makeFirstResponder:searchField];
}
@end