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 /win | |
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 'win')
-rw-r--r-- | win/ttkWinTheme.c | 11 | ||||
-rw-r--r-- | win/ttkWinXPTheme.c | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 41754ee..18c6405 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -1,6 +1,6 @@ /* winTheme.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net> * - * $Id: ttkWinTheme.c,v 1.8 2007/10/25 07:08:26 jenglish Exp $ + * $Id: ttkWinTheme.c,v 1.9 2007/11/08 01:40:25 jenglish Exp $ */ #ifdef _MSC_VER @@ -93,7 +93,7 @@ typedef struct int cxId; /* system metric id for size in x */ int cyId; /* system metric id for size in y */ Ttk_StateTable *stateMap; /* map Tk states to Win32 flags */ - Ttk_Padding padding; /* additional placement padding */ + Ttk_Padding margins; /* additional placement padding */ } FrameControlElementData; static FrameControlElementData FrameControlElements[] = @@ -129,10 +129,9 @@ static void FrameControlElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - FrameControlElementData *elementData = clientData; - *widthPtr = GetSystemMetrics(elementData->cxId); - *heightPtr = GetSystemMetrics(elementData->cyId); - *paddingPtr = elementData->padding; + FrameControlElementData *p = clientData; + *widthPtr = GetSystemMetrics(p->cxId) + Ttk_PaddingWidth(p->margins); + *heightPtr = GetSystemMetrics(p->cyId) + Ttk_PaddingHeight(p->margins); } static void FrameControlElementDraw( diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index e18d604..9f42cf6 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkWinXPTheme.c,v 1.13 2007/10/25 07:08:27 jenglish Exp $ + * $Id: ttkWinXPTheme.c,v 1.14 2007/11/08 01:40:26 jenglish Exp $ * * Tk theme engine which uses the Windows XP "Visual Styles" API * Adapted from Georgios Petasis' XP theme patch. @@ -493,6 +493,10 @@ static void GenericElementSize( /* See NOTE-GetThemeMargins */ *paddingPtr = elementData->info->padding; + if (elementData->info->flags & PAD_MARGINS) { + *widthPtr += Ttk_PaddingWidth(elementData->info->padding); + *heightPtr += Ttk_PaddingHeight(elementData->info->padding); + } } static void GenericElementDraw( |