changeset 3468:3122c2eec3e8

[gaim-migrate @ 3518] I found a GTK theme that I thought was really nice--but it didn't look nice in Gaim. So I made it look nice in Gaim. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 29 Aug 2002 06:24:25 +0000
parents 79e0d2f8ad2b
children 15089f9d3431
files ChangeLog src/gtkimhtml.c
diffstat 2 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Aug 29 03:22:21 2002 +0000
+++ b/ChangeLog	Thu Aug 29 06:24:25 2002 +0000
@@ -58,6 +58,7 @@
 	* Nice Oscar changes--mostly internal (Thanks Mark Doliner)
 	* event_del_conversation for plugins (Thanks Bill Tompkins)
 	* Code cleanups and fixes (Thanks Federico Mena Quintero)
+	* GtkIMHtml supports GTK theme background pixmaps
 
 version 0.59 (06/24/2002):
 	* Hungarian translation added (Thanks, Sutto Zoltan)
--- a/src/gtkimhtml.c	Thu Aug 29 03:22:21 2002 +0000
+++ b/src/gtkimhtml.c	Thu Aug 29 06:24:25 2002 +0000
@@ -431,9 +431,10 @@
 
 	imhtml->default_font = gdk_font_ref (GTK_IMHTML_GET_STYLE_FONT (widget->style));
 
-	gdk_window_set_background (widget->window, &widget->style->base [GTK_STATE_NORMAL]);
-	gdk_window_set_background (GTK_LAYOUT (imhtml)->bin_window,
-				   &widget->style->base [GTK_STATE_NORMAL]);
+	gtk_style_apply_default_background (widget->style, widget->window, TRUE, GTK_STATE_NORMAL,
+					    NULL, 0, 0, attributes.width, attributes.height);
+	gtk_style_apply_default_background (widget->style, GTK_LAYOUT(imhtml)->bin_window, TRUE, GTK_STATE_NORMAL,
+					    NULL, 0, 0, attributes.width, attributes.height);
 
 	imhtml->default_fg_color = gdk_color_copy (&GTK_WIDGET (imhtml)->style->fg [GTK_STATE_NORMAL]);
 	imhtml->default_bg_color = gdk_color_copy (&GTK_WIDGET (imhtml)->style->base [GTK_STATE_NORMAL]);
@@ -489,12 +490,16 @@
 	} else {
 		gdk_color_alloc (cmap, imhtml->default_bg_color);
 		gdk_gc_set_foreground (gc, imhtml->default_bg_color);
+		if (GTK_WIDGET(imhtml)->style->bg_pixmap[GTK_STATE_NORMAL]) {
+			gdk_gc_set_tile(gc, GTK_WIDGET(imhtml)->style->bg_pixmap[GTK_STATE_NORMAL]);
+			gdk_gc_set_fill (gc, GDK_TILED);
+		}
 		bg = imhtml->default_bg_color;
 	}
 
 	gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, line->y - yoff,
 			    line->width ? line->width : imhtml->xsize, line->height);
-
+	gdk_gc_set_fill(gc, GDK_SOLID);
 	if (!line->text) {
 		gdk_gc_unref (gc);
 		return;
@@ -644,9 +649,14 @@
 	} else {
 		gdk_color_alloc (cmap, imhtml->default_bg_color);
 		gdk_gc_set_foreground (gc, imhtml->default_bg_color);
+		if (GTK_WIDGET(imhtml)->style->bg_pixmap[GTK_STATE_NORMAL]) {
+			gdk_gc_set_tile(gc, GTK_WIDGET(imhtml)->style->bg_pixmap[GTK_STATE_NORMAL]);
+			gdk_gc_set_fill(gc, GDK_TILED);
+		}
 	}
 
 	gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, line->y - yoff, line->width, line->height);
+	gdk_gc_set_fill(gc, GDK_SOLID);
 
 	if (line->selected) {
 		gdk_color_alloc (cmap, imhtml->default_hl_color);
@@ -860,6 +870,7 @@
 	gdk_window_set_background (widget->window, &widget->style->base [GTK_STATE_NORMAL]);
 	gdk_window_set_background (GTK_LAYOUT (imhtml)->bin_window,
 				   &widget->style->base [GTK_STATE_NORMAL]);
+	
 	gtk_imhtml_draw_exposed (imhtml);
 }