diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 643617cac..8c81090ee 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -783,6 +783,15 @@ APPKIT_EXPORT_CLASS */ - (NSString*) license; +/** + * Returns YES if in dark mode, or NO, if not. The reasoning behind this + * is that some applications may display on the screen in dark mode, but + * print with the colors reversed. This method allows GUI and the backend + * to understand when we are using a dark theme and render accordingly when + * printing. The default is NO, as the default theme is not a dark theme. + */ +- (BOOL) isDarkMode; + @end /** diff --git a/Source/GSTheme.m b/Source/GSTheme.m index 2067be731..b3a3fbe31 100644 --- a/Source/GSTheme.m +++ b/Source/GSTheme.m @@ -1339,6 +1339,12 @@ typedef struct { return [[self infoDictionary] objectForKey: @"GSThemeLicense"]; } +- (BOOL) isDarkMode +{ + return [[[self infoDictionary] objectForKey: @"GSThemeDarkMode"] + isEqualToString: @"YES"]; +} + @end @implementation GSTheme (Private)