diff options
author | jenglish <jenglish@flightlab.com> | 2007-11-08 01:40:24 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2007-11-08 01:40:24 (GMT) |
commit | 20121b9b291bee97ea1985c2b3c16470ee92afa1 (patch) | |
tree | add48b19aba5fd375a93fc51364bb2e52cfb953d /generic/ttk/ttkClamTheme.c | |
parent | 467a688247fb6279144a01f04bac8aac679d166b (diff) | |
download | tk-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/ttkClamTheme.c')
-rw-r--r-- | generic/ttk/ttkClamTheme.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 1ce75e0..39d38b4 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkClamTheme.c,v 1.6 2007/10/25 07:08:26 jenglish Exp $ + * $Id: ttkClamTheme.c,v 1.7 2007/11/08 01:40:24 jenglish Exp $ * * Copyright (C) 2004 Joe English * @@ -301,10 +301,12 @@ static void IndicatorElementSize( int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { IndicatorElement *indicator = elementRecord; + Ttk_Padding margins; int size = 10; - Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, paddingPtr); + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); - *widthPtr = *heightPtr = size; + *widthPtr = size + Ttk_PaddingWidth(margins); + *heightPtr = size + Ttk_PaddingHeight(margins); } static void RadioIndicatorElementDraw( @@ -418,10 +420,13 @@ static void MenuIndicatorElementSize( int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { MenuIndicatorElement *indicator = elementRecord; + Ttk_Padding margins; int size = MENUBUTTON_ARROW_SIZE; Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->paddingObj, &margins); TtkArrowSize(size, ARROW_DOWN, widthPtr, heightPtr); - Ttk_GetPaddingFromObj(NULL, tkwin, indicator->paddingObj, paddingPtr); + *widthPtr += Ttk_PaddingWidth(margins); + *heightPtr += Ttk_PaddingHeight(margins); } static void MenuIndicatorElementDraw( @@ -698,6 +703,8 @@ static void PbarElementSize( SliderElementSize(clientData, elementRecord, tkwin, widthPtr, heightPtr, paddingPtr); *paddingPtr = Ttk_UniformPadding(2); + *widthPtr += 4; + *heightPtr += 4; } static void PbarElementDraw( |