diff options
author | culler <culler> | 2018-05-01 19:14:59 (GMT) |
---|---|---|
committer | culler <culler> | 2018-05-01 19:14:59 (GMT) |
commit | da8c99c251fa91c34e272516f5c381724862ada8 (patch) | |
tree | 22b1b00903fa3c686f5a0fcb459bb5ea3aa32625 /macosx/tkMacOSXButton.c | |
parent | 6f8b1791a5659b74ebf1dda6c2107dd4bb26cdc1 (diff) | |
download | tk-da8c99c251fa91c34e272516f5c381724862ada8.zip tk-da8c99c251fa91c34e272516f5c381724862ada8.tar.gz tk-da8c99c251fa91c34e272516f5c381724862ada8.tar.bz2 |
Adjust button metrics in HITheme instead of Tk.
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r-- | macosx/tkMacOSXButton.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 0ed52db..964dcff 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -27,11 +27,11 @@ /* - * Default insets for controls + * Default insets for controls - used to adjust button metrics. */ -#define DEF_INSET_LEFT 12 -#define DEF_INSET_RIGHT 12 +#define DEF_INSET_LEFT 0 +#define DEF_INSET_RIGHT 0 #define DEF_INSET_TOP 1 #define DEF_INSET_BOTTOM 1 @@ -318,9 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - /*Remove extraneous padding around label widgets.*/ txtWidth = butPtr->textWidth; - txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; + txtHeight = butPtr->textHeight; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -396,7 +395,9 @@ TkpComputeButtonGeometry( int paddingx = 0; int paddingy = 0; - tmpRect = CGRectMake(0, 0, width, height); + tmpRect = CGRectMake(0, 0, + width + DEF_INSET_LEFT + DEF_INSET_RIGHT, + height + DEF_INSET_BOTTOM + DEF_INSET_TOP); HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); /* If the content region has a minimum height, match it. */ @@ -649,7 +650,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 + DEF_INSET_LEFT, y - DEF_INSET_BOTTOM, 0, -1); } /* |