Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4e64c49

Browse filesBrowse files
committed
ENH: Add dark/light mode theme to the buttons
This makes the images used for the buttons a template image which can be adjusted based on the system theme chosen by the user.
1 parent a9dd8b9 commit 4e64c49
Copy full SHA for 4e64c49

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎src/_macosx.m

Copy file name to clipboardExpand all lines: src/_macosx.m
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
881881
NSImage* image = [[NSImage alloc] initWithContentsOfFile: filename];
882882
buttons[i] = [[NSButton alloc] initWithFrame: rect];
883883
[image setSize: size];
884+
// Specify that it is a template image so the content tint
885+
// color gets updated with the system theme (dark/light)
886+
[image setTemplate: YES];
884887
[buttons[i] setBezelStyle: NSBezelStyleShadowlessSquare];
885888
[buttons[i] setButtonType: buttontypes[i]];
886889
[buttons[i] setImage: image];

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.