summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorcsaba <csaba>2024-05-10 17:29:53 (GMT)
committercsaba <csaba>2024-05-10 17:29:53 (GMT)
commit663ebf37ce118a2df9bb7d883143b8a585440b23 (patch)
treea516b425acaa9af3cd42e84e800e599feb4f9d3b /generic
parenta864407700fb5198a61456caa65624323415e744 (diff)
downloadtk-663ebf37ce118a2df9bb7d883143b8a585440b23.zip
tk-663ebf37ce118a2df9bb7d883143b8a585440b23.tar.gz
tk-663ebf37ce118a2df9bb7d883143b8a585440b23.tar.bz2
Code cleanup related mainly to the "classic" theme.
Diffstat (limited to 'generic')
-rw-r--r--generic/ttk/ttkClassicTheme.c7
-rw-r--r--generic/ttk/ttkElements.c8
2 files changed, 9 insertions, 6 deletions
diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c
index c0ac3ba..c0f9917 100644
--- a/generic/ttk/ttkClassicTheme.c
+++ b/generic/ttk/ttkClassicTheme.c
@@ -57,12 +57,13 @@ static void HighlightElementDraw(
{
HighlightElement *hl = (HighlightElement *)elementRecord;
int highlightThickness = 0;
- Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED;
XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj);
+ Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED;
Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness);
if (highlightColor && highlightThickness > 0) {
- Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, &defaultState);
+ Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj,
+ &defaultState);
GC gc = Tk_GCForColor(highlightColor, d);
if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) {
TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5);
@@ -437,7 +438,9 @@ static void MenuIndicatorElementDraw(
Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,&margins);
b = Ttk_PadBox(b, margins);
+#if 0
Tk_GetPixelsFromObj(NULL, tkwin, mi->borderWidthObj, &borderWidth);
+#endif
Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height,
borderWidth, TK_RELIEF_RAISED);
}
diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c
index a0ec77e..7ebc453 100644
--- a/generic/ttk/ttkElements.c
+++ b/generic/ttk/ttkElements.c
@@ -405,7 +405,7 @@ static const Ttk_ElementOptionSpec FocusElementOptions[] = {
static void FocusElementSize(
TCL_UNUSED(void *), /* clientData */
void *elementRecord,
- TCL_UNUSED(Tk_Window),
+ Tk_Window tkwin,
TCL_UNUSED(int *), /* widthPtr */
TCL_UNUSED(int *), /* heightPtr */
Ttk_Padding *paddingPtr)
@@ -413,7 +413,7 @@ static void FocusElementSize(
FocusElement *focus = (FocusElement *)elementRecord;
int focusThickness = 0;
- Tcl_GetIntFromObj(NULL, focus->focusThicknessObj, &focusThickness);
+ Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness);
*paddingPtr = Ttk_UniformPadding((short)focusThickness);
}
@@ -430,8 +430,8 @@ static void FocusElementDraw(
int focusSolid = 0;
if (state & TTK_STATE_FOCUS) {
- Tcl_GetIntFromObj(NULL,focus->focusThicknessObj,&focusThickness);
- Tcl_GetBooleanFromObj(NULL,focus->focusSolidObj,&focusSolid);
+ Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness);
+ Tcl_GetBooleanFromObj(NULL, focus->focusSolidObj, &focusSolid);
DrawFocusRing(tkwin, d, focus->focusColorObj, focusThickness,
focusSolid, b);
}