summaryrefslogtreecommitdiffstats
path: root/macosx/ttkMacOSXTheme.c
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2021-10-30 20:20:54 (GMT)
committermarc_culler <marc.culler@gmail.com>2021-10-30 20:20:54 (GMT)
commit0b1cc20f76bcf0efdd0f75e825628e6f4761cf7c (patch)
treeab194bf0a55d003bb6e95bc75c76be6ff5c1c802 /macosx/ttkMacOSXTheme.c
parentae9ec0f179b4d64a2fc92134c8d909c628e5a86d (diff)
downloadtk-0b1cc20f76bcf0efdd0f75e825628e6f4761cf7c.zip
tk-0b1cc20f76bcf0efdd0f75e825628e6f4761cf7c.tar.gz
tk-0b1cc20f76bcf0efdd0f75e825628e6f4761cf7c.tar.bz2
Buttons
Diffstat (limited to 'macosx/ttkMacOSXTheme.c')
-rw-r--r--macosx/ttkMacOSXTheme.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index 8379812..188272e 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -63,7 +63,10 @@
*/
static CGFloat darkButtonFace[4] = {
- 112.0 / 255, 113.0 / 255, 115.0 / 255, 1.0
+ 90.0 / 255, 86.0 / 255, 95.0 / 255, 1.0
+};
+static CGFloat darkPressedButtonFace[4] = {
+ 114.0 / 255, 110.0 / 255, 118.0 / 255, 1.0
};
static CGFloat darkPressedBevelFace[4] = {
135.0 / 255, 136.0 / 255, 138.0 / 255, 1.0
@@ -720,8 +723,15 @@ static void DrawDarkButton(
bounds = CGRectInset(bounds, 1, 1);
if (kind == kThemePushButton && (state & TTK_STATE_PRESSED)) {
- GradientFillRoundedRectangle(context, bounds, 4,
+ if ([NSApp macOSVersion] < 120000) {
+ GradientFillRoundedRectangle(context, bounds, 4,
pressedPushButtonGradient, 2);
+ } else {
+ faceColor = [NSColor colorWithColorSpace: deviceRGB
+ components: darkPressedButtonFace
+ count: 4];
+ SolidFillRoundedRectangle(context, bounds, 4, faceColor);
+ }
} else if (kind == kThemePushButton &&
(state & TTK_STATE_ALTERNATE) &&
!(state & TTK_STATE_BACKGROUND)) {