Skip to content

Commit 4e64c49

Browse 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

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
@@ -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)