summaryrefslogtreecommitdiffstats
path: root/win/ttkWinTheme.c
diff options
context:
space:
mode:
authorcsaba <csaba>2023-08-12 11:44:28 (GMT)
committercsaba <csaba>2023-08-12 11:44:28 (GMT)
commit69fee013bd2c45615c16eb36f7a0dc0151f81833 (patch)
treeb7a4f0feb953f49765d0ef096472598fbb7afd58 /win/ttkWinTheme.c
parent7c59a21c44fcc5027f7d193f5d6775605c4ee8ba (diff)
downloadtk-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 'win/ttkWinTheme.c')
-rw-r--r--win/ttkWinTheme.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index 35bde14..d526bfe 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -157,17 +157,9 @@ static void FrameControlElementSize(
int cy = GETMETRIC(p->cyId);
if ((p->cxId & _FIXEDSIZE) && cx == BASE_DIM) {
- /*
- * Retrieve the scaling factor (1.0, 1.25, 1.5, ...)
- * and multiply cx and cy by it
- */
- Tcl_Interp *interp = Tk_Interp(tkwin);
- const char *scalingPctPtr =
- Tcl_GetVar(interp, "::tk::scalingPct", TCL_GLOBAL_ONLY);
- double scalingFactor = (scalingPctPtr == NULL ? 1.0 :
- atof(scalingPctPtr) / 100);
- cx *= scalingFactor;
- cy *= scalingFactor;
+ double scalingLevel = TkScalingLevel(tkwin);
+ cx *= scalingLevel;
+ cy *= scalingLevel;
/*
* Update the corresponding element of the array FrameControlElements