summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenubutton.c
diff options
context:
space:
mode:
authorculler <culler>2019-05-16 13:03:28 (GMT)
committerculler <culler>2019-05-16 13:03:28 (GMT)
commit8175c0e93450e5523767039b7f4be7d89e7a63c9 (patch)
tree4c0e79f0319aceb030c4fbeb633598577dd2bc21 /macosx/tkMacOSXMenubutton.c
parentcdf0d2aad93208954b01d2446181854ba1221482 (diff)
downloadtk-8175c0e93450e5523767039b7f4be7d89e7a63c9.zip
tk-8175c0e93450e5523767039b7f4be7d89e7a63c9.tar.gz
tk-8175c0e93450e5523767039b7f4be7d89e7a63c9.tar.bz2
In Aqua, draw dark mode menubuttons as inactive, as is done for buttons.
This makes them imperfect, but usable. This is the best we can do as long as HITheme is used for drawing. For correct appearance use ttk::menubutton.
Diffstat (limited to 'macosx/tkMacOSXMenubutton.c')
-rw-r--r--macosx/tkMacOSXMenubutton.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c
index dbad8db..53adb01 100644
--- a/macosx/tkMacOSXMenubutton.c
+++ b/macosx/tkMacOSXMenubutton.c
@@ -580,6 +580,17 @@ TkMacOSXDrawMenuButton(
hiinfo.animation.time.start = hiinfo.animation.time.current;
}
+ /*
+ * To avoid menubuttons 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::menubutton would be a better choice,
+ * however.
+ */
+
+ if (TkMacOSXInDarkMode(butPtr->tkwin)) {
+ hiinfo.state = kThemeStateInactive;
+ }
+
HIThemeDrawButton(&cntrRect, &hiinfo, dc.context,
kHIThemeOrientationNormal, &contHIRec);
TkMacOSXRestoreDrawingContext(&dc);