summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorculler <culler>2019-04-08 19:19:00 (GMT)
committerculler <culler>2019-04-08 19:19:00 (GMT)
commit5d5e59d73025a9282d60db4092a176d307a9f63e (patch)
tree3ab3ec2399ae2336e5b05e2ba0608ac5d372eaae /macosx/tkMacOSXButton.c
parente5d4eeb37219de1ae1083da63410504618ed3557 (diff)
downloadtk-5d5e59d73025a9282d60db4092a176d307a9f63e.zip
tk-5d5e59d73025a9282d60db4092a176d307a9f63e.tar.gz
tk-5d5e59d73025a9282d60db4092a176d307a9f63e.tar.bz2
Make Treeview headings look correct in both light and dark modes. Make ordinary
ttk widgets respond to dark mode by using semantic color defaults.
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index a335703..0458a2c 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -770,6 +770,16 @@ TkMacOSXDrawButton(
hiinfo.animation.time.start = hiinfo.animation.time.current;
}
+ /*
+ * To avoid buttons with white text on a white background, we always
+ * set the state to inactive in Dark Mode. It isn't perfect but
+ * it is usable. Using a ttk::button would be a better choice,
+ * however.
+ */
+
+ if (TkMacOSXInDarkMode(butPtr->tkwin)) {
+ hiinfo.state = kThemeStateInactive;
+ }
HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal,
&contHIRec);