diff options
author | csaba <csaba> | 2023-08-12 11:44:28 (GMT) |
---|---|---|
committer | csaba <csaba> | 2023-08-12 11:44:28 (GMT) |
commit | 69fee013bd2c45615c16eb36f7a0dc0151f81833 (patch) | |
tree | b7a4f0feb953f49765d0ef096472598fbb7afd58 /unix/tkUnixButton.c | |
parent | 7c59a21c44fcc5027f7d193f5d6775605c4ee8ba (diff) | |
download | tk-69fee013bd2c45615c16eb36f7a0dc0151f81833.zip tk-69fee013bd2c45615c16eb36f7a0dc0151f81833.tar.gz tk-69fee013bd2c45615c16eb36f7a0dc0151f81833.tar.bz2 |
Improvements related to scaling and appearance in the built-in themes alt,
clam, and default.
Diffstat (limited to 'unix/tkUnixButton.c')
-rw-r--r-- | unix/tkUnixButton.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index c67f1fa..e4c9bf7 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.c @@ -172,20 +172,19 @@ TkpDrawCheckIndicator( { const char *svgDataPtr; int hasBorder, hasInterior, dim; + double scalingLevel = TkScalingLevel(tkwin); TkBorder *bg_brdr = (TkBorder*)bgBorder; char darkColorStr[7], lightColorStr[7], interiorColorStr[7], indicatorColorStr[7]; + Tcl_Interp *interp = Tk_Interp(tkwin); char imgName[60]; Tk_Image img; size_t svgDataLen; char *svgDataCopy; char *darkColorPtr, *lightColorPtr, *interiorColorPtr, *indicatorColorPtr; - Tcl_Interp *interp = Tk_Interp(tkwin); const char *cmdFmt; size_t scriptSize; char *script; int code; - const char *scalingPctPtr; - double scalingFactor; /* * Sanity check @@ -235,6 +234,7 @@ TkpDrawCheckIndicator( dim = RADIO_MENU_DIM; break; } + dim = (int)(dim * scalingLevel); /* * Construct the color strings darkColorStr, lightColorStr, @@ -339,14 +339,6 @@ TkpDrawCheckIndicator( } /* - * Retrieve the scaling factor (1.0, 1.25, 1.5, ...) and multiply dim by it - */ - - scalingPctPtr = Tcl_GetVar(interp, "::tk::scalingPct", TCL_GLOBAL_ONLY); - scalingFactor = (scalingPctPtr == NULL ? 1.0 : atof(scalingPctPtr) / 100); - dim = (int)(dim * scalingFactor); - - /* * Adjust the image's coordinates in the drawable and display the image */ |