From 4e64c496be9dd07df78eaafefb619c9bc287ce9d Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Sat, 5 Mar 2022 11:00:21 -0700 Subject: [PATCH] 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. --- src/_macosx.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/_macosx.m b/src/_macosx.m index b72d6efd4e0d..5c9688fdf6ad 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -881,6 +881,9 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); } NSImage* image = [[NSImage alloc] initWithContentsOfFile: filename]; buttons[i] = [[NSButton alloc] initWithFrame: rect]; [image setSize: size]; + // Specify that it is a template image so the content tint + // color gets updated with the system theme (dark/light) + [image setTemplate: YES]; [buttons[i] setBezelStyle: NSBezelStyleShadowlessSquare]; [buttons[i] setButtonType: buttontypes[i]]; [buttons[i] setImage: image]; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy