From 11a8051179a2a411a2a332f7128ae188d7e3bd93 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 11 Dec 1998 14:00:09 +0000 Subject: [PATCH] Added "style_set" handlers. Fri Dec 11 08:59:12 1998 Owen Taylor * gtk/gtklistitem.c (gtk_list_item_style_set): * gtk/gtklist.c (gtk_list_style_set): Added "style_set" handlers. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtklist.c | 12 ++++++++++++ gtk/gtklistitem.c | 13 +++++++++++++ 9 files changed, 67 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0ddd8bafe4..83360af656 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Fri Dec 11 08:59:12 1998 Owen Taylor + + * gtk/gtklistitem.c (gtk_list_item_style_set): + * gtk/gtklist.c (gtk_list_style_set): + Added "style_set" handlers. + Fri Dec 11 05:49:30 1998 Owen Taylor * gtk/gtkclist.c (gtk_clist_style_set): Add in a "style_set" diff --git a/gtk/gtklist.c b/gtk/gtklist.c index e7a9bc8393..18291954b0 100644 --- a/gtk/gtklist.c +++ b/gtk/gtklist.c @@ -46,6 +46,8 @@ static void gtk_list_size_allocate (GtkWidget *widget, static void gtk_list_realize (GtkWidget *widget); static void gtk_list_map (GtkWidget *widget); static void gtk_list_unmap (GtkWidget *widget); +static void gtk_list_style_set (GtkWidget *widget, + GtkStyle *previous_style); static void gtk_list_draw (GtkWidget *widget, GdkRectangle *area); static gint gtk_list_expose (GtkWidget *widget, @@ -218,6 +220,7 @@ gtk_list_class_init (GtkListClass *class) widget_class->map = gtk_list_map; widget_class->unmap = gtk_list_unmap; + widget_class->style_set = gtk_list_style_set; widget_class->realize = gtk_list_realize; widget_class->draw = gtk_list_draw; widget_class->expose_event = gtk_list_expose; @@ -806,6 +809,15 @@ gtk_list_expose (GtkWidget *widget, return FALSE; } +static void +gtk_list_style_set (GtkWidget *widget, + GtkStyle *previous_style) +{ + g_return_if_fail (widget != NULL); + + if (previous_style && GTK_WIDGET_REALIZED (widget)) + gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]); +} /* GtkContainer Methods : * gtk_list_add diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c index 69be352a90..de94536878 100644 --- a/gtk/gtklistitem.c +++ b/gtk/gtklistitem.c @@ -47,6 +47,8 @@ static void gtk_list_item_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_list_item_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static void gtk_list_item_style_set (GtkWidget *widget, + GtkStyle *previous_style); static void gtk_list_item_draw (GtkWidget *widget, GdkRectangle *area); static void gtk_list_item_draw_focus (GtkWidget *widget); @@ -182,6 +184,7 @@ gtk_list_item_class_init (GtkListItemClass *class) widget_class->realize = gtk_list_item_realize; widget_class->size_request = gtk_list_item_size_request; widget_class->size_allocate = gtk_list_item_size_allocate; + widget_class->style_set = gtk_list_item_style_set; widget_class->draw = gtk_list_item_draw; widget_class->draw_focus = gtk_list_item_draw_focus; widget_class->button_press_event = gtk_list_item_button_press; @@ -440,6 +443,16 @@ gtk_list_item_size_allocate (GtkWidget *widget, } } +static void +gtk_list_item_style_set (GtkWidget *widget, + GtkStyle *previous_style) +{ + g_return_if_fail (widget != NULL); + + if (previous_style && GTK_WIDGET_REALIZED (widget)) + gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]); +} + static void gtk_list_item_draw (GtkWidget *widget, GdkRectangle *area)