File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 99#import < Cocoa/Cocoa.h>
1010
1111IB_DESIGNABLE
12- @interface DragFileView : NSView
12+ @interface DragFileView : NSBox
1313
1414@property (readonly ) NSURL *fileURL;
1515
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ @interface DragFileView ()
1818@implementation DragFileView
1919
2020- (void )commonInit {
21- self.wantsLayer = YES ;
21+ self.boxType = NSBoxCustom;
22+ self.cornerRadius = 20.0 ;
23+ self.borderWidth = 0.0 ;
2224 [self setHighlight: NO ];
23- self.layer .cornerRadius = 20.0 ;
2425 [self registerForDraggedTypes: @[(NSString *)kUTTypeFileURL ]];
2526}
2627
@@ -34,9 +35,9 @@ - (instancetype)initWithFrame:(NSRect)frameRect {
3435
3536- (void )setHighlight : (BOOL )flag {
3637 if (flag) {
37- self.layer . backgroundColor = [[ NSColor colorWithCalibratedRed: 0.56 green: 0.7 blue: 0.81 alpha: 1.0 ] CGColor ];
38+ self.fillColor = [NSColor colorWithCalibratedRed: 0.56 green: 0.7 blue: 0.81 alpha: 1.0 ];
3839 } else {
39- self.layer . backgroundColor = [[ NSColor colorWithCalibratedRed: 0.7 green: 0.85 blue: 1.0 alpha: 1.0 ] CGColor ];
40+ self.fillColor = [NSColor colorWithCalibratedRed: 0.7 green: 0.85 blue: 1.0 alpha: 1.0 ];
4041 }
4142}
4243
You can’t perform that action at this time.
0 commit comments