ITSwitch icon indicating copy to clipboard operation
ITSwitch copied to clipboard

change colours for Dark Mode

Open sweetppro opened this issue 7 years ago • 4 comments

how can I completely redraw the switch to update the _disabledBorderColor? I tried overriding, and updating the _disabledBorderColor in: - (void) setNeedsDisplay:(BOOL)needsDisplay

and while, the method is called when Dark Mode is enabled/disabled - the _disabledBorderColor in the switch does not change

sweetppro avatar Apr 14 '19 11:04 sweetppro

This project doesn't support dark mode. I don't develop for MacOS anymore. I will accept PRs though.

iluuu1994 avatar Apr 14 '19 11:04 iluuu1994

its seems to not work with the color I have chosen: disabledControlTextColor. controlAccentColor works just fine like this:

- (void) setNeedsDisplay:(BOOL)needsDisplay
{
    [super setNeedsDisplay:needsDisplay];    
    [self setUpLayers];
}

sweetppro avatar Apr 14 '19 14:04 sweetppro

There is no property called disabledControlTextColor. Not every color in this project is configurable. Sorry, you're on your own.

iluuu1994 avatar Apr 14 '19 19:04 iluuu1994

ah, thats an NSColor. I managed to get it working how I like using this fork: https://github.com/Tibbs/ITSwitch

and adding this for immediate updating when Dark Mode is activated/deactivated:

- (void) setNeedsDisplay:(BOOL)needsDisplay
{
    [super setNeedsDisplay:needsDisplay];
    [self setUpLayers];
}

sweetppro avatar Apr 14 '19 19:04 sweetppro