Skip to content

Commit fbfcacc

Browse 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

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/_macosx.m

+3
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)