/
MyOutlineCellView.m
53 lines (48 loc) · 1.32 KB
/
MyOutlineCellView.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
//
// MyOutlineCellView.m
// spires
//
// Created by Yuji on 2018/08/27.
//
#import "MyOutlineCellView.h"
#import "ArticleList.h"
#import "SideOutlineViewController.h"
@implementation MyOutlineCellView
@synthesize articleList=_articleList;
-(void)setArticleList:(ArticleList *)articleList
{
_articleList=articleList;
self.imageView.image=self.articleList.icon;
self.textField.stringValue=self.articleList.name;
self.imageView.enabled=YES;
self.imageView.hidden=NO;
self.button.enabled=NO;
self.button.hidden=YES;
}
-(IBAction)articleListNameEdited:(NSTextField*)sender
{
self.articleList.name=sender.stringValue;
}
-(IBAction)articleListImageClicked:(NSButton*)sender
{
if(self.articleList.hasButton){
[self.articleList reload];
}
[self.sideOutlineViewController selectArticleList:self.articleList];
}
-(void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle
{
[super setBackgroundStyle:backgroundStyle];
if(self.articleList.hasButton && self.backgroundStyle==NSBackgroundStyleDark){
self.imageView.enabled=NO;
self.imageView.hidden=YES;
self.button.enabled=YES;
self.button.hidden=NO;
}else{
self.imageView.enabled=YES;
self.imageView.hidden=NO;
self.button.enabled=NO;
self.button.hidden=YES;
}
}
@end