Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MUPopoverBackgroundView.m « Classes « Source - github.com/mumble-voip/mumble-iphoneos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ce884b4f6666212797550e78e983e9342a6b86c (plain)
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
// Copyright 2009-2012 The 'Mumble for iOS' Developers. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#import "MUPopoverBackgroundView.h"

@interface MUPopoverBackgroundView () {
    UIImageView *_imgView;
}
@end

@implementation MUPopoverBackgroundView

- (id) initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        UIEdgeInsets insets = UIEdgeInsetsMake(41.0f, 47.0f, 10.0f, 10.0f);
        UIImage *img = [UIImage imageNamed:@"_UIPopoverViewBlackBackgroundArrowUp"];
        UIImage *stretchableImg = [img resizableImageWithCapInsets:insets];
        
        _imgView = [[UIImageView alloc] initWithImage:stretchableImg];
        [self addSubview:_imgView];
    }
    return self;
}

- (void) dealloc {
    [_imgView release];
    [super dealloc];
}

- (UIPopoverArrowDirection) arrowDirection {
    return UIPopoverArrowDirectionUp;
}

- (void) setArrowDirection:(UIPopoverArrowDirection)arrowDirection {
}

- (CGFloat) arrowOffset {
    return 0.0f;
}

- (void) setArrowOffset:(CGFloat)arrowOffset {
}

+ (CGFloat) arrowBase {
    return 35.0f;
}

+ (CGFloat) arrowHeight {
    return 19.0f;
}

+ (UIEdgeInsets) contentViewInsets {
    return UIEdgeInsetsMake(8.0f, 11.0f, 11.0f, 11.0f);
}

- (void) layoutSubviews {
    [super layoutSubviews];
    _imgView.frame = self.frame;
}

@end