|
From: Dom L. <ci...@us...> - 2005-11-12 04:15:33
|
Update of /cvsroot/gtk-wimp/gtk-wimp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26261/src Modified Files: msw_style.c Log Message: make menubars and toolbars look more IE-ish Index: msw_style.c =================================================================== RCS file: /cvsroot/gtk-wimp/gtk-wimp/src/msw_style.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** msw_style.c 21 Oct 2005 21:25:39 -0000 1.31 --- msw_style.c 12 Nov 2005 04:15:17 -0000 1.32 *************** *** 569,574 **** GdkColor text_prelight; - gboolean xp_theme = xp_theme_is_active(); - /* Prelight */ sys_color_to_gtk_color(XP_THEME_CLASS_TEXT, COLOR_HIGHLIGHTTEXT, &fg_prelight); --- 569,572 ---- *************** *** 638,642 **** btn_face.green, btn_face.blue, ! (xp_theme ? "etched-in" : "out")); gtk_rc_parse_string(buf); --- 636,640 ---- btn_face.green, btn_face.blue, ! "etched-in"); gtk_rc_parse_string(buf); *************** *** 647,652 **** "GtkToolbar::shadow-type = %s\n" "}widget_class \"*HandleBox*\" style \"msw-toolbar\"\n", ! (xp_theme ? "none" : "out"), ! (xp_theme ? "none" : "out")); gtk_rc_parse_string(buf); --- 645,650 ---- "GtkToolbar::shadow-type = %s\n" "}widget_class \"*HandleBox*\" style \"msw-toolbar\"\n", ! "etched-in", ! "etched-in"); gtk_rc_parse_string(buf); *************** *** 1814,1817 **** --- 1812,1817 ---- gint height) { + gboolean is_handlebox_grippie = (detail && !strcmp(detail, "handlebox")); + if(detail && ! strcmp(detail, "entry")) { *************** *** 1822,1825 **** --- 1822,1966 ---- } } + + if(is_handlebox_grippie || (widget && (shadow_type == GTK_SHADOW_ETCHED_IN) && (GTK_IS_MENU_BAR(widget) || GTK_IS_TOOLBAR(widget) || GTK_IS_HANDLE_BOX(widget)))) { + GdkGC *gc1 = NULL; + GdkGC *gc2 = NULL; + gint thickness_light; + gint thickness_dark; + gint i; + + gc1 = style->light_gc[state_type]; + gc2 = style->dark_gc[state_type]; + + sanitize_size (window, &width, &height); + + if (area) + { + gdk_gc_set_clip_rectangle (gc1, area); + gdk_gc_set_clip_rectangle (gc2, area); + if (shadow_type == GTK_SHADOW_IN || + shadow_type == GTK_SHADOW_OUT) + { + gdk_gc_set_clip_rectangle (style->black_gc, area); + gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area); + } + } + + if (style->xthickness > 0) + { + if (style->xthickness > 1) + { + thickness_light = 1; + thickness_dark = 1; + + for (i = 0; i < thickness_dark; i++) + { + if(!is_handlebox_grippie) + gdk_draw_line (window, gc1, + x + width - i - 1, + y + i, + x + width - i - 1, + y + height - i - 1); + if(is_handlebox_grippie || (widget && GTK_IS_MENU_BAR(widget))) + gdk_draw_line (window, gc2, + x + i, + y + i, + x + i, + y + height - i - 1); + } + + for (i = 0; i < thickness_light; i++) + { + if(is_handlebox_grippie || (widget && GTK_IS_MENU_BAR(widget))) + gdk_draw_line (window, gc1, + x + thickness_dark + i, + y + thickness_dark + i, + x + thickness_dark + i, + y + height - thickness_dark - i - 1); + if(!is_handlebox_grippie) + gdk_draw_line (window, gc2, + x + width - thickness_light - i - 1, + y + thickness_dark + i, + x + width - thickness_light - i - 1, + y + height - thickness_light - 1); + } + } + else + { + gdk_draw_line (window, + style->dark_gc[state_type], + x, y, x, y + height); + gdk_draw_line (window, + style->dark_gc[state_type], + x + width, y, x + width, y + height); + } + } + + if (style->ythickness > 0) + { + if (style->ythickness > 1) + { + thickness_light = 1; + thickness_dark = 1; + + for (i = 0; i < thickness_dark; i++) + { + gdk_draw_line (window, gc1, + x + i, + y + height - i - 1, + x + width - i - 1, + y + height - i - 1); + + if(widget && GTK_IS_MENU_BAR(widget)) + gdk_draw_line (window, gc2, + x + i, + y + i, + x + width - i - 2, + y + i); + } + + for (i = 0; i < thickness_light; i++) + { + gdk_draw_line (window, gc2, + x + thickness_dark + i, + y + height - thickness_light - i - 1, + x + width - thickness_light - 1, + y + height - thickness_light - i - 1); + + if(widget && GTK_IS_MENU_BAR(widget)) + gdk_draw_line (window, gc1, + x + thickness_dark + i, + y + thickness_dark + i, + x + width - thickness_dark - i - 2, + y + thickness_dark + i); + } + } + else + { + gdk_draw_line (window, + style->dark_gc[state_type], + x, y, x + width, y); + + gdk_draw_line (window, + style->dark_gc[state_type], + x, y + height, x + width, y + height); + + } + } + + if (area) + { + gdk_gc_set_clip_rectangle (gc1, NULL); + gdk_gc_set_clip_rectangle (gc2, NULL); + if (shadow_type == GTK_SHADOW_IN || + shadow_type == GTK_SHADOW_OUT) + { + gdk_gc_set_clip_rectangle (style->black_gc, NULL); + gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL); + } + } + + return; + } parent_class->draw_shadow (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); *************** *** 1837,1857 **** gint y) { - #if 0 - if (detail && !strcmp(detail, "menuitem")) { - if (xp_theme_draw(window, XP_THEME_ELEMENT_MENU_SEPARATOR, style, - x1, y, x2, style->ythickness, state_type, area)) { - return; - } - } else if (detail && !strcmp(detail, "toolbar")) { - if (xp_theme_draw(window, XP_THEME_ELEMENT_TOOLBAR_SEPARATOR_H, style, - x1, y, x2, style->ythickness, state_type, area)) { - return; - } - } - - if(xp_theme_draw(window, XP_THEME_ELEMENT_LINE_H, style, x1, y, x2, style->ythickness, state_type, area)) - return; - #endif - parent_class->draw_hline (style, window, state_type, area, widget, detail, x1, x2, y); --- 1978,1981 ---- *************** *** 1869,1884 **** gint x) { - #if 0 - if (detail && !strcmp(detail, "toolbar")) { - if (xp_theme_draw(window, XP_THEME_ELEMENT_TOOLBAR_SEPARATOR_V, style, - x, y1, style->xthickness, y2, state_type, area)) { - return; - } - } - - if(xp_theme_draw(window, XP_THEME_ELEMENT_LINE_V, style, x, y1, style->xthickness, y2, state_type, area)) - return; - #endif - parent_class->draw_vline (style, window, state_type, area, widget, detail, y1, y2, x); --- 1993,1996 ---- *************** *** 1980,1984 **** ythick = style->ythickness; ! dest.x = x + xthick; dest.y = y + ythick; dest.width = width - (xthick * 2); --- 2092,2096 ---- ythick = style->ythickness; ! dest.x = x + xthick + 2; dest.y = y + ythick; dest.width = width - (xthick * 2); |