summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-04-07 02:18:22 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-04-07 02:18:22 (GMT)
commite775b13da67a5d546caac2cf1a2c76d63d80d254 (patch)
treeeada5f6f8b66048ffdb316cba2b650eae62bc8d0 /macosx/tkMacOSXButton.c
parent809ebd7b888f6a543597c4a087f50f2719093108 (diff)
downloadtk-e775b13da67a5d546caac2cf1a2c76d63d80d254.zip
tk-e775b13da67a5d546caac2cf1a2c76d63d80d254.tar.gz
tk-e775b13da67a5d546caac2cf1a2c76d63d80d254.tar.bz2
Backing out changes; unexpected issues with window resizing that require further investigation
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 0323081..c1dec90 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -30,10 +30,10 @@
* Default insets for controls
*/
-#define DEF_INSET_LEFT 12
-#define DEF_INSET_RIGHT 12
-#define DEF_INSET_TOP 1
-#define DEF_INSET_BOTTOM 1
+#define DEF_INSET_LEFT 2
+#define DEF_INSET_RIGHT 2
+#define DEF_INSET_TOP 2
+#define DEF_INSET_BOTTOM 4
/*
* Some defines used to control what type of control is drawn.
@@ -318,8 +318,8 @@ TkpComputeButtonGeometry(
Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
- txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT;
- txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP;
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
Tk_GetFontMetrics(butPtr->tkfont, &fm);
haveText = (txtWidth != 0 && txtHeight != 0);
@@ -647,7 +647,7 @@ DrawButtonImageAndText(
butPtr->textHeight, &x, &y);
x += butPtr->indicatorSpace;
Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout,
- x, y - DEF_INSET_BOTTOM, 0, -1);
+ x, y, 0, -1);
}
/*
@@ -807,12 +807,9 @@ TkMacOSXDrawButton(
hiinfo.animation.time.start = hiinfo.animation.time.current;
}
- HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal,
- &contHIRec);
-
+ HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec);
TkMacOSXRestoreDrawingContext(&dc);
- ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo,
- (MacButton *)mbPtr, 32, true);
+ ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true);
} else {
if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) {
@@ -1210,4 +1207,3 @@ PulseDefaultButtonProc(ClientData clientData)
mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler(
PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData);
}
-