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 f57b50e commit f80ecc8
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 @@ -926,17 +926,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 @@ -1832,6 +1839,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 f80ecc8

Please sign in to comment.