Skip to content

Commit

Permalink
background Image
Browse files Browse the repository at this point in the history
  • Loading branch information
groverlynn committed Jun 30, 2023
1 parent 94f1852 commit 91c2575
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions SquirrelPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -924,17 +924,24 @@ - (void)drawRect:(NSRect)dirtyRect {
borderPath.windingRule = NSEvenOddWindingRule;
}

// set layers]
// set layers
_shape.path = [backgroundPath quartzPath];
_shape.fillColor = [[NSColor whiteColor] CGColor];
_shape.cornerRadius = theme.cornerRadius;
CAShapeLayer *textContainerLayer = [[CAShapeLayer alloc] init];
textContainerLayer.path = [textContainerPath quartzPath];
textContainerLayer.fillColor = [[NSColor whiteColor] CGColor];
[self.layer setSublayers: NULL];
CAShapeLayer *panelLayer = [[CAShapeLayer alloc] init];
textContainerLayer.cornerRadius = theme.hilitedCornerRadius;
[self.layer setSublayers:NULL];
self.layer.cornerRadius = theme.cornerRadius;
if (theme.backgroundImage) {
panelLayer.backgroundColor = [theme.backgroundImage CGColor];
CAShapeLayer *backgroundLayer = [[CAShapeLayer alloc] init];
backgroundLayer.path = [backgroundPath quartzPath];
backgroundLayer.fillColor = [theme.backgroundImage CGColor];
backgroundLayer.cornerRadius = theme.cornerRadius;
[self.layer addSublayer:backgroundLayer];
}
CAShapeLayer *panelLayer = [[CAShapeLayer alloc] init];
panelLayer.path = [textContainerPath quartzPath];
panelLayer.fillColor = [theme.backgroundColor CGColor];
[self.layer addSublayer:panelLayer];
Expand Down Expand Up @@ -1829,6 +1836,7 @@ - (void)updateStatusLong:(NSString *)messageLong statusShort:(NSString *)message
}

- (void)showStatus:(NSString *)message {
[self getMaxTextWidth];
SquirrelTheme *theme = _view.currentTheme;
NSMutableAttributedString *text = [[NSMutableAttributedString alloc]
initWithString:message.precomposedStringWithCanonicalMapping
Expand Down

0 comments on commit 91c2575

Please sign in to comment.