summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-01-12 12:16:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-01-12 12:16:23 (GMT)
commit2ece75e8790071956e71a9f917a6b68ab94b6ff3 (patch)
treed9fbfe9432a5c5302565bb3500e04acbd4eca005 /generic
parentcb5357c61dfae8f487063e332ff8e2ac16fc57cb (diff)
downloadtk-2ece75e8790071956e71a9f917a6b68ab94b6ff3.zip
tk-2ece75e8790071956e71a9f917a6b68ab94b6ff3.tar.gz
tk-2ece75e8790071956e71a9f917a6b68ab94b6ff3.tar.bz2
Change -gripsize back to -gripcount (name change can be done later as a separate step)
Diffstat (limited to 'generic')
-rw-r--r--generic/ttk/ttkClamTheme.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c
index 4f47d06..807090e 100644
--- a/generic/ttk/ttkClamTheme.c
+++ b/generic/ttk/ttkClamTheme.c
@@ -487,7 +487,7 @@ static const Ttk_ElementSpec MenuIndicatorElementSpec =
typedef struct {
Tcl_Obj *lightColorObj;
Tcl_Obj *borderColorObj;
- Tcl_Obj *gripSizeObj;
+ Tcl_Obj *gripCountObj;
} GripElement;
static const Ttk_ElementOptionSpec GripElementOptions[] = {
@@ -495,8 +495,8 @@ static const Ttk_ElementOptionSpec GripElementOptions[] = {
offsetof(GripElement,lightColorObj), LIGHT_COLOR },
{ "-bordercolor", TK_OPTION_COLOR,
offsetof(GripElement,borderColorObj), DARKEST_COLOR },
- { "-gripsize", TK_OPTION_PIXELS,
- offsetof(GripElement,gripSizeObj), "10" },
+ { "-gripcount", TK_OPTION_PIXELS,
+ offsetof(GripElement,gripCountObj), "5" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
@@ -509,7 +509,8 @@ static void GripElementSize(
int gripSize = 0;
(void)paddingPtr;
- Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize);
+ Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize);
+ gripSize *= 2;
if (orient == TTK_ORIENT_HORIZONTAL) {
*widthPtr = gripSize;
} else {
@@ -530,7 +531,8 @@ static void GripElementDraw(
int i;
(void)state;
- Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize);
+ Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize);
+ gripSize *= 2;
if (orient == TTK_ORIENT_HORIZONTAL) {
int x = b.x + (b.width - gripSize) / 2;
@@ -571,7 +573,7 @@ typedef struct { /* Common element record for scrollbar elements */
Tcl_Obj *darkColorObj;
Tcl_Obj *arrowColorObj;
Tcl_Obj *arrowSizeObj;
- Tcl_Obj *gripSizeObj;
+ Tcl_Obj *gripCountObj;
Tcl_Obj *sliderlengthObj;
} ScrollbarElement;
@@ -592,8 +594,8 @@ static const Ttk_ElementOptionSpec ScrollbarElementOptions[] = {
offsetof(ScrollbarElement,arrowColorObj), "#000000" },
{ "-arrowsize", TK_OPTION_PIXELS,
offsetof(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) },
- { "-gripsize", TK_OPTION_PIXELS,
- offsetof(ScrollbarElement,gripSizeObj), "10" },
+ { "-gripcount", TK_OPTION_PIXELS,
+ offsetof(ScrollbarElement,gripCountObj), "5" },
{ "-sliderlength", TK_OPTION_INT,
offsetof(ScrollbarElement,sliderlengthObj), "30" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
@@ -631,7 +633,7 @@ static void ThumbElementSize(
(void)tkwin;
(void)paddingPtr;
- Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size);
+ Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &size);
*widthPtr = *heightPtr = size;
}
@@ -658,7 +660,8 @@ static void ThumbElementDraw(
* Draw grip:
*/
TtkGetOrientFromObj(NULL, sb->orientObj, &orient);
- Tk_GetPixelsFromObj(NULL, tkwin, sb->gripSizeObj, &gripSize);
+ Tk_GetPixelsFromObj(NULL, tkwin, sb->gripCountObj, &gripSize);
+ gripSize *= 2;
lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d);
darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d);
@@ -704,7 +707,7 @@ static void SliderElementSize(
length = thickness = SCROLLBAR_THICKNESS;
TtkGetOrientFromObj(NULL, sb->orientObj, &orient);
- Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &thickness);
+ Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &thickness);
Tk_GetPixelsFromObj(NULL, tkwin, sb->sliderlengthObj, &length);
if (orient == TTK_ORIENT_VERTICAL) {
*heightPtr = length;
@@ -778,7 +781,7 @@ static void ArrowElementSize(
(void)tkwin;
(void)paddingPtr;
- Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size);
+ Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &size);
*widthPtr = *heightPtr = size;
}