summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-02-12 16:01:25 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-02-12 16:01:25 (GMT)
commitea244cc080877648787abafed6ca504c8d6a6e10 (patch)
tree656479e7b34dbe58b760b93e452acf71b8801842
parent7187b8fcc22f915f42da6873079c79969b031b03 (diff)
downloadtk-ea244cc080877648787abafed6ca504c8d6a6e10.zip
tk-ea244cc080877648787abafed6ca504c8d6a6e10.tar.gz
tk-ea244cc080877648787abafed6ca504c8d6a6e10.tar.bz2
Limit hard-coded padding in Cocoa buttons to radiobuttons indicatorOn
-rw-r--r--macosx/tkMacOSXButton.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 9c2196f..09027fe 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -378,19 +378,27 @@ TkpComputeButtonGeometry(
width += 2 * butPtr->padX;
height += 2 * butPtr->padY;
- /* Need special handling for radiobuttons and checkbuttons:
+ /* Need special handling for radiobuttons and checkbuttons:
the text and images is drawn right on top of the button unless
we expand the width. This is not perfect; some radiobuttons may render
on top anyway.
*/
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;
@@ -408,7 +416,6 @@ TkpComputeButtonGeometry(
}
break;
}
-
/*
* Now figure out the size of the border decorations for the button.