-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMLPrescriptionView.m
55 lines (45 loc) · 1.24 KB
/
MLPrescriptionView.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
//
// MLPrescriptionView.m
// AmiKo
//
// Created by b123400 on 2020/10/15.
// Copyright © 2020 Ywesee GmbH. All rights reserved.
//
#import "MLPrescriptionView.h"
@implementation MLPrescriptionView {
NSView *_findBarView;
BOOL _findBarVisible;
CGFloat _findBarHeight;
}
- (instancetype)initWithCoder:(NSCoder *)coder {
_findBarHeight = 32;
return [super initWithCoder:coder];
}
- (void)findBarViewDidChangeHeight {
_findBarHeight = self.findBarView.frame.size.height;
self.textFinderContainerViewHeight.constant = _findBarHeight;
CGSize barSize = self.findBarView.frame.size;
self.findBarView.frame = CGRectMake(0, 0, self.frame.size.width, barSize.height);
}
- (NSView*)findBarView {
return _findBarView;
}
- (void)setFindBarView:(NSView *)findBarView {
_findBarView = findBarView;
[self.textFinderContainerView addSubview:findBarView];
}
- (void)setFindBarVisible:(BOOL)findBarVisible {
_findBarVisible = findBarVisible;
if (findBarVisible) {
self.textFinderContainerViewHeight.constant = _findBarHeight;
} else {
self.textFinderContainerViewHeight.constant = 0;
}
}
- (BOOL)isFindBarVisible {
return _findBarVisible;
}
- (NSView *)contentView {
return self;
}
@end