mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-23 04:00:00 +00:00
Implement NSShowAllViews
This commit is contained in:
parent
afde656ba5
commit
e04c5af6a8
@ -250,6 +250,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
}
|
||||
}
|
||||
|
||||
- (NSColor *) _borderColorForNSShowAllViews {
|
||||
return [NSColor cyanColor];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSButton (BindingSupport)
|
||||
|
@ -35,6 +35,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (NSColor *) _borderColorForNSShowAllViews {
|
||||
return [NSColor yellowColor];
|
||||
}
|
||||
|
||||
-(void)drawRect:(NSRect)rect {
|
||||
NSRect bounds=[self bounds];
|
||||
CGFloat cheatSheet = 0;
|
||||
|
@ -47,10 +47,17 @@ NSString * const NSViewFocusDidChangeNotification=@"NSViewFocusDidChangeNotifica
|
||||
|
||||
@implementation NSView
|
||||
|
||||
static BOOL NSViewLayersEnabled=NO;
|
||||
static BOOL NSViewLayersEnabled = NO;
|
||||
static BOOL NSShowAllViews = NO;
|
||||
|
||||
+(void)initialize {
|
||||
NSViewLayersEnabled=[[NSUserDefaults standardUserDefaults] boolForKey:@"NSViewLayersEnabled"];
|
||||
+ (void) initialize {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSViewLayersEnabled = [defaults boolForKey: @"NSViewLayersEnabled"];
|
||||
NSShowAllViews = [defaults boolForKey: @"NSShowAllViews"];
|
||||
}
|
||||
|
||||
- (NSColor *) _borderColorForNSShowAllViews {
|
||||
return [NSColor orangeColor];
|
||||
}
|
||||
|
||||
+(NSView *)focusView {
|
||||
@ -2049,8 +2056,13 @@ static NSGraphicsContext *graphicsContextForView(NSView *view){
|
||||
[[NSColor yellowColor] set];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
else
|
||||
[self drawRect:rect];
|
||||
else {
|
||||
[self drawRect:rect];
|
||||
if (NSShowAllViews) {
|
||||
[[self _borderColorForNSShowAllViews] set];
|
||||
NSFrameRect(rect);
|
||||
}
|
||||
}
|
||||
|
||||
[self unlockFocus];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user