diff options
author | csaba <csaba> | 2023-02-06 21:00:43 (GMT) |
---|---|---|
committer | csaba <csaba> | 2023-02-06 21:00:43 (GMT) |
commit | 47d43951ef1e711b869a669463e6d70a674be86c (patch) | |
tree | f9208e6731ee614faae273722a0d6587198e4963 /generic | |
parent | 36a64bec13a510beadaf1838b4ad31afde99f155 (diff) | |
download | tk-47d43951ef1e711b869a669463e6d70a674be86c.zip tk-47d43951ef1e711b869a669463e6d70a674be86c.tar.gz tk-47d43951ef1e711b869a669463e6d70a674be86c.tar.bz2 |
Made the indicators of the Tk core checkbuttons and radiobuttons on Windows and the ones of the ttk::checkbutton and ttk::radiobutton widgets of the winnative theme scaling-aware
Diffstat (limited to 'generic')
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 47a2751..a8b13f0 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -563,13 +563,13 @@ static void IndicatorElementDraw( double scalingFactor; const IndicatorSpec *spec = (const IndicatorSpec *)clientData; - int index; - const char *svgDataPtr; char bgColorStr[7], fgColorStr[7], indicatorColorStr[7], shadeColorStr[7], borderColorStr[7]; + int index; char imgName[70]; Tk_Image img; + const char *svgDataPtr; size_t svgDataLen; char *svgDataCopy; char *shadeColorPtr, *highlightColorPtr, *borderColorPtr, *bgColorPtr, @@ -603,12 +603,6 @@ static void IndicatorElementDraw( } /* - * Determine the SVG data to use for the photo image - */ - index = Ttk_StateTableLookup(spec->map, state); - svgDataPtr = (index % 2 == 0 ? spec->offDataPtr : spec->onDataPtr); - - /* * Construct the color strings bgColorStr, fgColorStr, * indicatorColorStr, shadeColorStr, and borderColorStr */ @@ -627,14 +621,20 @@ static void IndicatorElementDraw( * Check whether there is an SVG image for the indicator's * type (0 = checkbtn, 1 = radiobtn) and these color strings */ + index = Ttk_StateTableLookup(spec->map, state); snprintf(imgName, sizeof(imgName), - "::tk::icons::alt_indicator%d_%s_%s_%s_%s_%s", + "::tk::icons::indicator_alt%d_%s_%s_%s_%s_%s", spec->offDataPtr == radiobtnOffData, shadeColorStr, indicatorColorStr, borderColorStr, bgColorStr, index % 2 == 1 ? fgColorStr : "XXXXXX"); img = Tk_GetImage(interp, tkwin, imgName, ImageChanged, NULL); if (img == NULL) { /* + * Determine the SVG data to use for the photo image + */ + svgDataPtr = (index % 2 == 0 ? spec->offDataPtr : spec->onDataPtr); + + /* * Copy the string pointed to by svgDataPtr to a newly allocated memory * area svgDataCopy and assign the latter's address to svgDataPtr */ |