Update of /cvsroot/gtk-wimp/gtk-wimp/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7450/src
Modified Files:
msw_style.c
Log Message:
better toolbox handle drawing
Index: msw_style.c
===================================================================
RCS file: /cvsroot/gtk-wimp/gtk-wimp/src/msw_style.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** msw_style.c 28 Jun 2005 14:51:31 -0000 1.27
--- msw_style.c 25 Jul 2005 19:15:33 -0000 1.28
***************
*** 1964,1978 ****
if (!GTK_IS_PANED(widget)) {
- gint xx, yy;
gint xthick, ythick;
! GdkGC *light_gc, *dark_gc;
GdkRectangle dest;
! if ((width == -1) && (height == -1))
! gdk_window_get_size(window, &width, &height);
! else if (width == -1)
! gdk_window_get_size(window, &width, NULL);
! else if (height == -1)
! gdk_window_get_size(window, NULL, &height);
gtk_paint_box(style, window, state_type, shadow_type, area, widget,
--- 1964,1972 ----
if (!GTK_IS_PANED(widget)) {
gint xthick, ythick;
! GdkGC *light_gc, *dark_gc, *shadow_gc;
GdkRectangle dest;
! sanitize_size (window, &width, &height);
gtk_paint_box(style, window, state_type, shadow_type, area, widget,
***************
*** 1981,1984 ****
--- 1975,1979 ----
light_gc = style->light_gc[state_type];
dark_gc = style->dark_gc[state_type];
+ shadow_gc = style->mid_gc[state_type];
xthick = style->xthickness;
***************
*** 1992,2015 ****
gdk_gc_set_clip_rectangle(light_gc, &dest);
gdk_gc_set_clip_rectangle(dark_gc, &dest);
if (orientation == GTK_ORIENTATION_VERTICAL)
{
! yy = y + ythick;
! for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
! {
! gdk_draw_line(window, light_gc, xx, yy, xx, yy + height - ythick);
! gdk_draw_line(window, dark_gc, xx + 1, yy, xx + 1, yy + height - ythick);
!
! gdk_draw_line(window, light_gc, xx + 3, yy, xx + 3, yy + height - ythick);
! gdk_draw_line(window, dark_gc, xx + 4, yy, xx + 4, yy + height - ythick);
! }
}
else
{
! draw_hline(style, window, state_type, area, widget, detail,
! x, x+width, y+1);
! draw_hline(style, window, state_type, area, widget, detail,
! x, x+width, y+3);
}
gdk_gc_set_clip_rectangle(light_gc, NULL);
gdk_gc_set_clip_rectangle(dark_gc, NULL);
--- 1987,2006 ----
gdk_gc_set_clip_rectangle(light_gc, &dest);
gdk_gc_set_clip_rectangle(dark_gc, &dest);
+ gdk_gc_set_clip_rectangle(shadow_gc, &dest);
if (orientation == GTK_ORIENTATION_VERTICAL)
{
! gdk_draw_line(window, light_gc, dest.x, dest.y, dest.x, dest.height);
! gdk_draw_line(window, dark_gc, dest.x + (dest.width / 2), dest.y, dest.x + (dest.width / 2), dest.height);
! gdk_draw_line(window, shadow_gc, dest.x + dest.width, dest.y, dest.x + dest.width, dest.height);
}
else
{
! gdk_draw_line(window, light_gc, dest.x, dest.y, dest.x + dest.width, dest.y);
! gdk_draw_line(window, dark_gc, dest.x, dest.y + (dest.height / 2), dest.x + dest.width, dest.y + (dest.height / 2));
! gdk_draw_line(window, shadow_gc, dest.x, dest.y + dest.height, dest.x + dest.width, dest.y + dest.height);
}
+
+ gdk_gc_set_clip_rectangle(shadow_gc, NULL);
gdk_gc_set_clip_rectangle(light_gc, NULL);
gdk_gc_set_clip_rectangle(dark_gc, NULL);
|