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 fbfcacc

Browse filesBrowse files
authored
Merge pull request #22607 from greglucas/macosx-button-theme
ENH: Add dark/light mode theme to the buttons
2 parents 808dbe4 + 4e64c49 commit fbfcacc
Copy full SHA for fbfcacc

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
@@ -873,6 +873,9 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
873873
NSImage* image = [[NSImage alloc] initWithContentsOfFile: filename];
874874
buttons[i] = [[NSButton alloc] initWithFrame: rect];
875875
[image setSize: size];
876+
// Specify that it is a template image so the content tint
877+
// color gets updated with the system theme (dark/light)
878+
[image setTemplate: YES];
876879
[buttons[i] setBezelStyle: NSBezelStyleShadowlessSquare];
877880
[buttons[i] setButtonType: buttontypes[i]];
878881
[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.