summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-11-12 19:22:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-11-12 19:22:36 (GMT)
commitee7e7bafbc3b4a75acd87dab966877649e6929f5 (patch)
tree7069038f7878e3ffef29646eda6f34b25c4d1bc3 /generic/ttk
parentad604020165fcc7705d4e29258e936e25eece01a (diff)
downloadtk-ee7e7bafbc3b4a75acd87dab966877649e6929f5.zip
tk-ee7e7bafbc3b4a75acd87dab966877649e6929f5.tar.gz
tk-ee7e7bafbc3b4a75acd87dab966877649e6929f5.tar.bz2
merge updates from HEAD
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkClamTheme.c15
-rw-r--r--generic/ttk/ttkDefaultTheme.c22
-rw-r--r--generic/ttk/ttkElements.c38
-rw-r--r--generic/ttk/ttkImage.c4
-rw-r--r--generic/ttk/ttkTheme.c4
-rw-r--r--generic/ttk/ttkTreeview.c8
6 files changed, 54 insertions, 37 deletions
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c
index 4cd3924..b1dea77 100644
--- a/generic/ttk/ttkClamTheme.c
+++ b/generic/ttk/ttkClamTheme.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkClamTheme.c,v 1.5.2.1 2007/10/27 04:23:15 dgp Exp $
+ * $Id: ttkClamTheme.c,v 1.5.2.2 2007/11/12 19:22:37 dgp 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(
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index 109f646..c4720e1 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -1,4 +1,4 @@
-/* $Id: ttkDefaultTheme.c,v 1.7.2.2 2007/11/05 14:24:16 dgp Exp $
+/* $Id: ttkDefaultTheme.c,v 1.7.2.3 2007/11/12 19:22:37 dgp 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(
diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c
index 8c61f7d..94fadfb 100644
--- a/generic/ttk/ttkElements.c
+++ b/generic/ttk/ttkElements.c
@@ -1,4 +1,4 @@
-/* $Id: ttkElements.c,v 1.6.2.1 2007/10/27 04:23:15 dgp Exp $
+/* $Id: ttkElements.c,v 1.6.2.2 2007/11/12 19:22:37 dgp Exp $
*
* Copyright (c) 2003, Joe English
*
@@ -531,10 +531,12 @@ static void SquareIndicatorElementSize(
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
IndicatorElement *indicator = elementRecord;
+ Ttk_Padding margins;
int diameter = 0;
- Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, paddingPtr);
+ 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 SquareIndicatorElementDraw(
@@ -571,10 +573,12 @@ static void DiamondIndicatorElementSize(
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
IndicatorElement *indicator = elementRecord;
+ Ttk_Padding margins;
int diameter = 0;
- Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, paddingPtr);
+ Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins);
Tk_GetPixelsFromObj(NULL, tkwin, indicator->diameterObj, &diameter);
- *widthPtr = *heightPtr = diameter + 3;
+ *widthPtr = diameter + 3 + Ttk_PaddingWidth(margins);
+ *heightPtr = diameter + 3 + Ttk_PaddingHeight(margins);
}
static void DiamondIndicatorElementDraw(
@@ -673,9 +677,12 @@ static void MenuIndicatorElementSize(
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
MenuIndicatorElement *mi = elementRecord;
+ Ttk_Padding margins;
Tk_GetPixelsFromObj(NULL, tkwin, mi->widthObj, widthPtr);
Tk_GetPixelsFromObj(NULL, tkwin, mi->heightObj, heightPtr);
- Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,paddingPtr);
+ Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj, &margins);
+ *widthPtr += Ttk_PaddingWidth(margins);
+ *heightPtr += Ttk_PaddingHeight(margins);
}
static void MenuIndicatorElementDraw(
@@ -735,7 +742,7 @@ static Ttk_ElementOptionSpec ArrowElementOptions[] =
{ NULL }
};
-static Ttk_Padding ArrowPadding = { 3,3,3,3 };
+static Ttk_Padding ArrowMargins = { 3,3,3,3 };
static void ArrowElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
@@ -746,9 +753,10 @@ static void ArrowElementSize(
int width = 14;
Tk_GetPixelsFromObj(NULL, tkwin, arrow->sizeObj, &width);
- width -= Ttk_PaddingWidth(ArrowPadding);
+ width -= Ttk_PaddingWidth(ArrowMargins);
TtkArrowSize(width/2, direction, widthPtr, heightPtr);
- *paddingPtr = ArrowPadding;
+ *widthPtr += Ttk_PaddingWidth(ArrowMargins);
+ *heightPtr += Ttk_PaddingWidth(ArrowMargins);
}
static void ArrowElementDraw(
@@ -768,7 +776,7 @@ static void ArrowElementDraw(
tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, relief);
TtkFillArrow(Tk_Display(tkwin), d, Tk_GCForColor(arrowColor, d),
- Ttk_PadBox(b, ArrowPadding), direction);
+ Ttk_PadBox(b, ArrowMargins), direction);
}
static Ttk_ElementSpec ArrowElementSpec =
@@ -1075,16 +1083,14 @@ static void PbarElementSize(
switch (orient) {
case TTK_ORIENT_HORIZONTAL:
- *widthPtr = length;
- *heightPtr = thickness;
+ *widthPtr = length + 2 * borderWidth;
+ *heightPtr = thickness + 2 * borderWidth;
break;
case TTK_ORIENT_VERTICAL:
- *widthPtr = thickness;
- *heightPtr = length;
+ *widthPtr = thickness + 2 * borderWidth;
+ *heightPtr = length + 2 * borderWidth;
break;
}
-
- *paddingPtr = Ttk_UniformPadding((short)borderWidth);
}
static void PbarElementDraw(
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index acc4e8f..018e2b8 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -1,4 +1,4 @@
-/* $Id: ttkImage.c,v 1.5 2006/12/14 19:51:04 jenglish Exp $
+/* $Id: ttkImage.c,v 1.5.2.1 2007/11/12 19:22:37 dgp Exp $
* Image specifications and image element factory.
*
* Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net>
@@ -258,8 +258,6 @@ static void ImageElementSize(
}
*paddingPtr = imageData->padding;
- *widthPtr -= Ttk_PaddingWidth(imageData->padding);
- *heightPtr -= Ttk_PaddingHeight(imageData->padding);
}
static void ImageElementDraw(
diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c
index a16ba00..3dc1178 100644
--- a/generic/ttk/ttkTheme.c
+++ b/generic/ttk/ttkTheme.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * $Id: ttkTheme.c,v 1.6 2007/01/11 19:59:26 jenglish Exp $
+ * $Id: ttkTheme.c,v 1.6.2.1 2007/11/12 19:22:37 dgp Exp $
*/
#include <stdlib.h>
@@ -1095,8 +1095,6 @@ Ttk_ElementSize(
element->specPtr->size(
element->clientData, element->elementRecord,
tkwin, widthPtr, heightPtr, paddingPtr);
- *widthPtr += paddingPtr->left + paddingPtr->right;
- *heightPtr += paddingPtr->top + paddingPtr->bottom;
}
/*
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 531dca5..39af902 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -1,4 +1,4 @@
-/* $Id: ttkTreeview.c,v 1.16.2.3 2007/11/05 14:24:17 dgp Exp $
+/* $Id: ttkTreeview.c,v 1.16.2.4 2007/11/12 19:22:38 dgp Exp $
* Copyright (c) 2004, Joe English
*
* ttk::treeview widget implementation.
@@ -3099,12 +3099,14 @@ static void TreeitemIndicatorSize(
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
TreeitemIndicator *indicator = elementRecord;
+ Ttk_Padding margins;
int size = 0;
- Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginsObj, paddingPtr);
+ Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginsObj, &margins);
Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size);
- *widthPtr = *heightPtr = size;
+ *widthPtr = size + Ttk_PaddingWidth(margins);
+ *heightPtr = size + Ttk_PaddingHeight(margins);
}
static void TreeitemIndicatorDraw(