Skip to content

Commit

Permalink
adding icons
Browse files Browse the repository at this point in the history
  • Loading branch information
cescofry committed Jul 9, 2013
1 parent 3f49c93 commit b71d875
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 276 deletions.
2 changes: 1 addition & 1 deletion HiperStrings/Views/ZFFileExportCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ @implementation ZFFileExportCell

- (void)awakeFromNib {
[super awakeFromNib];
NSRect rect = self.titleLbl.frame;
NSRect rect = self.detailLbl.frame;
rect.size.width -= BTN_W;
NSRect btnRect = NSMakeRect(rect.size.width, rect.origin.y, BTN_W, self.bounds.size.height);

Expand Down
40 changes: 30 additions & 10 deletions HiperStrings/Views/ZFFileViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,50 @@

#import "ZFFileViewCell.h"

@interface ZFFileViewCell ()

@property (nonatomic, strong) NSImageView *iOSIcon;
@property (nonatomic, strong) NSImageView *androidIcon;

@end

@implementation ZFFileViewCell

- (void)awakeFromNib {
[super awakeFromNib];
NSRect frame = self.bounds;
CGRect labelFrame;
CGRect iconFrame;
CGRect frame = self.bounds;
frame.size.height = ceil(frame.size.height /2);
self.titleLbl = [[NSTextField alloc] initWithFrame:frame];
[self addSubview:self.titleLbl];

frame.origin.y += frame.size.height;
self.detailLbl = [[NSTextField alloc] initWithFrame:frame];
CGRectDivide(frame, &iconFrame, &labelFrame, 30, CGRectMinXEdge);

self.detailLbl = [[NSTextField alloc] initWithFrame:labelFrame];
[self.detailLbl setBordered:NO];
[self addSubview:self.detailLbl];

self.androidIcon = [[NSImageView alloc] initWithFrame:iconFrame];
[self.androidIcon setImage:[NSImage imageNamed:@"android_icon"]];
[self addSubview:self.androidIcon];

labelFrame.origin.y += labelFrame.size.height;
self.titleLbl = [[NSTextField alloc] initWithFrame:labelFrame];
[self.titleLbl setBordered:NO];
[self addSubview:self.titleLbl];

iconFrame.origin.y += iconFrame.size.height;
self.iOSIcon = [[NSImageView alloc] initWithFrame:iconFrame];
[self.iOSIcon setImage:[NSImage imageNamed:@"iOS_icon"]];
[self addSubview:self.iOSIcon];

}


- (void)setLangFile:(ZFTranslationFile *)langFile {
_langFile = langFile;
if (_langFile.iOSName.length > 0) [self.titleLbl setStringValue:_langFile.iOSName];
if (_langFile.androidName.length > 0) [self.detailLbl setStringValue:_langFile.androidName];
}

- (void)drawRect:(NSRect)dirtyRect
{
// Drawing code here.
[self setNeedsDisplay:YES];
}

@end
Loading

0 comments on commit b71d875

Please sign in to comment.