Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method that tells the app/backend that we are using a dark mode theme #326

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Headers/Additions/GNUstepGUI/GSTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
6 changes: 6 additions & 0 deletions Source/GSTheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,12 @@ - (NSString *) license
return [[self infoDictionary] objectForKey: @"GSThemeLicense"];
}

- (BOOL) isDarkMode
{
return [[[self infoDictionary] objectForKey: @"GSThemeDarkMode"]
isEqualToString: @"YES"];
}

@end

@implementation GSTheme (Private)
Expand Down
Loading