summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkDefaultTheme.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2006-11-14 22:44:30 (GMT)
committerjenglish <jenglish@flightlab.com>2006-11-14 22:44:30 (GMT)
commitec0f31f7586f53663f156175c39235356beb09e6 (patch)
treeba8cdd6068d38c38423d44703d373c410b53b51b /generic/ttk/ttkDefaultTheme.c
parent7655aa17f84f65e0da4755467acff756c7e3a33c (diff)
downloadtk-ec0f31f7586f53663f156175c39235356beb09e6.zip
tk-ec0f31f7586f53663f156175c39235356beb09e6.tar.gz
tk-ec0f31f7586f53663f156175c39235356beb09e6.tar.bz2
Fix off-by-one bug in tree indicator size computation [#1596021,
patch from Tim Baker]. Increased default size from 7 to 9 pixels.
Diffstat (limited to 'generic/ttk/ttkDefaultTheme.c')
-rw-r--r--generic/ttk/ttkDefaultTheme.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index 6971b3e..6d3f9f4 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -1,4 +1,4 @@
-/* $Id: ttkDefaultTheme.c,v 1.3 2006/11/03 03:06:22 das Exp $
+/* $Id: ttkDefaultTheme.c,v 1.4 2006/11/14 22:44:30 jenglish Exp $
*
* Copyright (c) 2003, Joe English
*
@@ -1051,7 +1051,7 @@ static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] =
{ "-foreground", TK_OPTION_COLOR,
Tk_Offset(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND },
{ "-diameter", TK_OPTION_PIXELS,
- Tk_Offset(TreeitemIndicator,diameterObj), "6" },
+ Tk_Offset(TreeitemIndicator,diameterObj), "9" },
{ "-indicatormargins", TK_OPTION_STRING,
Tk_Offset(TreeitemIndicator,marginObj), "0 2 4 2" },
{NULL}
@@ -1088,15 +1088,15 @@ static void TreeitemIndicatorDraw(
b = Ttk_PadBox(b, padding);
XDrawRectangle(Tk_Display(tkwin), d, gc,
- b.x, b.y, b.width, b.height);
+ b.x, b.y, b.width - 1, b.height - 1);
- cx = b.x + b.width / 2;
- cy = b.y + b.height / 2;
- XDrawLine(Tk_Display(tkwin), d, gc, b.x+2, cy, b.x+b.width-2+w, cy);
+ cx = b.x + (b.width - 1) / 2;
+ cy = b.y + (b.height - 1) / 2;
+ XDrawLine(Tk_Display(tkwin), d, gc, b.x+2, cy, b.x+b.width-3+w, cy);
if (!(state & TTK_STATE_OPEN)) {
/* turn '-' into a '+' */
- XDrawLine(Tk_Display(tkwin), d, gc, cx, b.y+2, cx, b.y+b.height-2+w);
+ XDrawLine(Tk_Display(tkwin), d, gc, cx, b.y+2, cx, b.y+b.height-3+w);
}
}