diff --git a/ChangeLog b/ChangeLog index b41af2d9c7..bc526c92b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-01-30 Daniel Elstner + + * gtk/gtkcolorsel.c (palette_paint): Explicitely draw an opaque + rectangle using the background color rather than relying on + gdk_window_clear_area(), so that the palette works properly with + pixmap themes. + + * demos/gtk-demo/colorsel.c: Install an "expose_event" handler + to fill the drawing area in the background color. + Wed Jan 29 14:11:21 2003 Hidetoshi Tajima * modules/input/gtkimcontextxim.c (choose_better_style): fix a memory diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b41af2d9c7..bc526c92b1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2003-01-30 Daniel Elstner + + * gtk/gtkcolorsel.c (palette_paint): Explicitely draw an opaque + rectangle using the background color rather than relying on + gdk_window_clear_area(), so that the palette works properly with + pixmap themes. + + * demos/gtk-demo/colorsel.c: Install an "expose_event" handler + to fill the drawing area in the background color. + Wed Jan 29 14:11:21 2003 Hidetoshi Tajima * modules/input/gtkimcontextxim.c (choose_better_style): fix a memory diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b41af2d9c7..bc526c92b1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2003-01-30 Daniel Elstner + + * gtk/gtkcolorsel.c (palette_paint): Explicitely draw an opaque + rectangle using the background color rather than relying on + gdk_window_clear_area(), so that the palette works properly with + pixmap themes. + + * demos/gtk-demo/colorsel.c: Install an "expose_event" handler + to fill the drawing area in the background color. + Wed Jan 29 14:11:21 2003 Hidetoshi Tajima * modules/input/gtkimcontextxim.c (choose_better_style): fix a memory diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b41af2d9c7..bc526c92b1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2003-01-30 Daniel Elstner + + * gtk/gtkcolorsel.c (palette_paint): Explicitely draw an opaque + rectangle using the background color rather than relying on + gdk_window_clear_area(), so that the palette works properly with + pixmap themes. + + * demos/gtk-demo/colorsel.c: Install an "expose_event" handler + to fill the drawing area in the background color. + Wed Jan 29 14:11:21 2003 Hidetoshi Tajima * modules/input/gtkimcontextxim.c (choose_better_style): fix a memory diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b41af2d9c7..bc526c92b1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2003-01-30 Daniel Elstner + + * gtk/gtkcolorsel.c (palette_paint): Explicitely draw an opaque + rectangle using the background color rather than relying on + gdk_window_clear_area(), so that the palette works properly with + pixmap themes. + + * demos/gtk-demo/colorsel.c: Install an "expose_event" handler + to fill the drawing area in the background color. + Wed Jan 29 14:11:21 2003 Hidetoshi Tajima * modules/input/gtkimcontextxim.c (choose_better_style): fix a memory diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c index 11156cdec8..45d46e7f71 100644 --- a/demos/gtk-demo/colorsel.c +++ b/demos/gtk-demo/colorsel.c @@ -12,6 +12,27 @@ static GtkWidget *da; static GdkColor color; static GtkWidget *frame; +/* Expose callback for the drawing area + */ +static gboolean +expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data) +{ + if (widget->window) + { + GtkStyle *style; + + style = gtk_widget_get_style (widget); + + gdk_draw_rectangle (widget->window, + style->bg_gc[GTK_STATE_NORMAL], + TRUE, + event->area.x, event->area.y, + event->area.width, event->area.height); + } + + return TRUE; +} + static void change_color_callback (GtkWidget *button, gpointer data) @@ -76,8 +97,12 @@ do_colorsel (void) frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); - + da = gtk_drawing_area_new (); + + g_signal_connect (da, "expose_event", + G_CALLBACK (expose_event_callback), NULL); + /* set a minimum size */ gtk_widget_set_size_request (da, 200, 200); /* set the color */ diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index c0d9def65d..e0c1d8f70a 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -607,12 +607,11 @@ palette_paint (GtkWidget *drawing_area, { if (drawing_area->window == NULL) return; - - gdk_window_clear_area (drawing_area->window, - area->x, - area->y, - area->width, - area->height); + + gdk_draw_rectangle (drawing_area->window, + drawing_area->style->bg_gc[GTK_STATE_NORMAL], + TRUE, + area->x, area->y, area->width, area->height); if (GTK_WIDGET_HAS_FOCUS (drawing_area)) {