mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-27 18:57:42 +00:00
make the background of the graphic white, while making the rest of the background
the theme-based color
This commit is contained in:
parent
00e4b82a4e
commit
a12b59db6c
2 changed files with 22 additions and 2 deletions
|
|
@ -10,9 +10,29 @@
|
|||
|
||||
@implementation KMAboutBGView
|
||||
|
||||
// draw white behind the graphic at the top of the view,
|
||||
// draw the theme's background color behind the rest of the view
|
||||
// e.g., rect origin=(0,0) size=(318,450)
|
||||
// topImgView origin=(15,252) size=(58,400)
|
||||
// topFill origin=(0,252) size=(66,450)
|
||||
// botFill origin=(0,0) size=(252,450)
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
NSRect topFill, botFill;
|
||||
topFill = rect;
|
||||
botFill = rect;
|
||||
// NSLog(@"rect origin x %f y %f size h %f w %f", rect.origin.x, rect.origin.y, rect.size.height, rect.size.width);
|
||||
NSView *topImgView = [self viewWithTag:1];
|
||||
// NSLog(@"topImgView origin x %f y %f size h %f w %f before", topImgView.frame.origin.x, topImgView.frame.origin.y, topImgView.frame.size.height, topImgView.frame.size.width);
|
||||
NSInteger imgOriginHeightDelta = topImgView.frame.origin.y - rect.origin.y;
|
||||
topFill.origin.y += imgOriginHeightDelta;
|
||||
topFill.size.height -= imgOriginHeightDelta;
|
||||
botFill.size.height = imgOriginHeightDelta;
|
||||
// NSLog(@"topFill origin x %f y %f size h %f w %f after raising to imgHeight %ld", topFill.origin.x, topFill.origin.y, topFill.size.height, topFill.size.width, imgOriginHeightDelta);
|
||||
// NSLog(@"botFill origin x %f y %f size h %f w %f after reducing by imgHeight %ld", botFill.origin.x, botFill.origin.y, botFill.size.height, botFill.size.width, imgOriginHeightDelta);
|
||||
[[NSColor whiteColor] setFill];
|
||||
NSRectFillUsingOperation(topFill, NSCompositeSourceOver);
|
||||
[[NSColor windowBackgroundColor] setFill];
|
||||
NSRectFillUsingOperation(rect, NSCompositeSourceOver);
|
||||
NSRectFillUsingOperation(botFill, NSCompositeSourceOver);
|
||||
}
|
||||
|
||||
- (BOOL)mouseDownCanMoveWindow {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
<action selector="configAction:" target="-2" id="3W6-cm-6P5"/>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView autoresizesSubviews="NO" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UOr-Co-IuK">
|
||||
<imageView autoresizesSubviews="NO" horizontalHuggingPriority="251" verticalHuggingPriority="251" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="UOr-Co-IuK">
|
||||
<rect key="frame" x="15" y="252" width="400" height="58"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="58" id="AMG-Zr-ebx"/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue