diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/KMBarView.m b/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/KMBarView.m index b9a400706a3..8364a6cb310 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/KMBarView.m +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/KMBarView.m @@ -7,31 +7,39 @@ // #import "KMBarView.h" +#import "KMLogs.h" @implementation KMBarView +/** + * draws stripe in three colors as part of Keyman branding + * over half is orange, followed by red and blue segments + */ - (void)drawRect:(NSRect)rect { CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] CGContext]; - NSRect rect1 = NSMakeRect(0, 0, rect.size.width*0.56, rect.size.height); - NSRect rect2 = NSMakeRect(rect1.size.width, 0, rect.size.width*0.23, rect.size.height); - NSRect rect3 = NSMakeRect(rect2.origin.x + rect2.size.width, 0, rect.size.width*0.21, rect.size.height); + NSRect barRect = self.frame; + os_log_debug([KMLogs uiLog], "KMBarView drawRect: %{public}@ frame: %{public}@", NSStringFromRect(rect), NSStringFromRect(barRect)); + + NSRect orangeRect = NSMakeRect(0, 0, barRect.size.width*0.56, barRect.size.height); + NSRect redRect = NSMakeRect(orangeRect.size.width, 0, barRect.size.width*0.23, barRect.size.height); + NSRect blueRect = NSMakeRect(redRect.origin.x + redRect.size.width, 0, barRect.size.width*0.21, barRect.size.height); CGContextSetFillColorWithColor(context, [NSColor colorWithSRGBRed:246.0/255.0 green:137.0/255.0 blue:36.0/255.0 alpha:1.0].CGColor); CGContextBeginPath(context); - CGContextAddRect(context, rect1); + CGContextAddRect(context, orangeRect); CGContextClosePath(context); CGContextDrawPath(context, kCGPathFill); CGContextSetFillColorWithColor(context, [NSColor colorWithSRGBRed:204.0/255.0 green:56.0/255.0 blue:70.0/255.0 alpha:1.0].CGColor); CGContextBeginPath(context); - CGContextAddRect(context, rect2); + CGContextAddRect(context, redRect); CGContextClosePath(context); CGContextDrawPath(context, kCGPathFill); CGContextSetFillColorWithColor(context, [NSColor colorWithSRGBRed:121.0/255.0 green:195.0/255.0 blue:218.0/255.0 alpha:1.0].CGColor); CGContextBeginPath(context); - CGContextAddRect(context, rect3); + CGContextAddRect(context, blueRect); CGContextClosePath(context); CGContextDrawPath(context, kCGPathFill); }