Skip to content

Problems with 10.10 #14

@copa

Description

@copa

The icon in the status bar will not appear. This code should solve the issue.

- (void)drawRect:(NSRect)dirtyRect{
    [self.statusItem drawStatusBarBackgroundInRect:dirtyRect withHighlight:self.isActive];

    NSImage *icon = self.isActive ? self.alternateImage : self.image;
    NSSize iconSize = [icon size];
    NSRect bounds = self.bounds;
    CGFloat iconX = roundf((NSWidth(bounds) - iconSize.width) / 2);
    CGFloat iconY = roundf((NSHeight(bounds) - iconSize.height) / 2);
    NSPoint iconPoint = NSMakePoint(iconX, iconY);

    [icon drawAtPoint:iconPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
    }

In addition I would change the declaration of the private interface. I saw this code in PR #7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions