OSXUIUtils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifdef __APPLE__ | |
struct OSXUIUtils | |
{ | |
static void setDarkTheme(void* view); | |
}; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "OSXUIUtils.h" | |
#import <AppKit/AppKit.h> | |
void OSXUIUtils::setDarkTheme(void* view) | |
{ | |
NSView* nsView = (NSView*)view; | |
NSWindow* nsWindow = [nsView window]; | |
NSAppearance* appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]; | |
[nsWindow setAppearance:appearance]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage from a JUCE app: