summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkDefaultTheme.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-11-08 01:40:24 (GMT)
committerjenglish <jenglish@flightlab.com>2007-11-08 01:40:24 (GMT)
commit20121b9b291bee97ea1985c2b3c16470ee92afa1 (patch)
treeadd48b19aba5fd375a93fc51364bb2e52cfb953d /generic/ttk/ttkDefaultTheme.c
parent467a688247fb6279144a01f04bac8aac679d166b (diff)
downloadtk-20121b9b291bee97ea1985c2b3c16470ee92afa1.zip
tk-20121b9b291bee97ea1985c2b3c16470ee92afa1.tar.gz
tk-20121b9b291bee97ea1985c2b3c16470ee92afa1.tar.bz2
Ttk_ElementSize: Fixed longstanding, subtle bug that caused element padding
to sometimes be counted twice in size computations. Fix ElementSizeProcs affected by previous change.
Diffstat (limited to 'generic/ttk/ttkDefaultTheme.c')
-rw-r--r--generic/ttk/ttkDefaultTheme.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index 0e8c35d..54bb450 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -1,4 +1,4 @@
-/* $Id: ttkDefaultTheme.c,v 1.9 2007/11/05 00:00:00 jenglish Exp $
+/* $Id: ttkDefaultTheme.c,v 1.10 2007/11/08 01:40:25 jenglish Exp $
*
* Copyright (c) 2003, Joe English
*
@@ -496,9 +496,10 @@ static void IndicatorElementSize(
{
IndicatorSpec *spec = clientData;
IndicatorElement *indicator = elementRecord;
- Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, paddingPtr);
- *widthPtr = spec->width;
- *heightPtr = spec->height;
+ Ttk_Padding margins;
+ Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins);
+ *widthPtr = spec->width + Ttk_PaddingWidth(margins);
+ *heightPtr = spec->height + Ttk_PaddingHeight(margins);
}
static void IndicatorElementDraw(
@@ -649,7 +650,8 @@ static void ArrowElementSize(
Tk_GetPixelsFromObj(NULL, tkwin, arrow->sizeObj, &width);
width -= Ttk_PaddingWidth(ArrowPadding);
TtkArrowSize(width/2, direction, widthPtr, heightPtr);
- *paddingPtr = ArrowPadding;
+ *widthPtr += Ttk_PaddingWidth(ArrowPadding);
+ *heightPtr += Ttk_PaddingHeight(ArrowPadding);
}
static void ArrowElementDraw(
@@ -722,7 +724,8 @@ static void MenubuttonArrowElementSize(
int size = MENUBUTTON_ARROW_SIZE;
Tk_GetPixelsFromObj(NULL, tkwin, arrow->sizeObj, &size);
*widthPtr = *heightPtr = 2 * size + 1;
- *paddingPtr = MenubuttonArrowPadding;
+ *widthPtr += Ttk_PaddingWidth(MenubuttonArrowPadding);
+ *heightPtr += Ttk_PaddingHeight(MenubuttonArrowPadding);
}
static void MenubuttonArrowElementDraw(
@@ -1058,9 +1061,12 @@ static void TreeitemIndicatorSize(
{
TreeitemIndicator *indicator = elementRecord;
int diameter = 0;
- Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, paddingPtr);
+ Ttk_Padding margins;
+
+ Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins);
Tk_GetPixelsFromObj(NULL, tkwin, indicator->diameterObj, &diameter);
- *widthPtr = *heightPtr = diameter;
+ *widthPtr = diameter + Ttk_PaddingWidth(margins);
+ *heightPtr = diameter + Ttk_PaddingHeight(margins);
}
static void TreeitemIndicatorDraw(