From e6c243fdce70320e6a12d97dea20f3a6b9ae056c Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 12 Feb 2015 16:01:13 +0000 Subject: Limit hard-coded padding in Cocoa buttons to radiobuttons indicatorOn --- macosx/tkMacOSXButton.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index d676641..bf55634 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -386,12 +386,20 @@ TkpComputeButtonGeometry( */ switch (butPtr->type) { case TYPE_RADIO_BUTTON: - /*Pad radiobutton by 50 to ensure image does not draw right over - radiobutton on left.*/ + /*Pad radiobutton by 50 if indicatorOn to ensure image does not draw + right over radiobutton on left.*/ if (butPtr->image != None) { - width += 50; + if (butPtr->indicatorOn) { + width += 50; + } else { + width += 0; + } } else if (butPtr->bitmap != None) { - width +=50; + if (butPtr->indicatorOn) { + width += 50; + } else { + width += 0; + } } else { /*If just text, just add width of string.*/ width += txtWidth; -- cgit v0.12