diff --git a/ChangeLog b/ChangeLog index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0d5588062c..425b1d3c37 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Wed Aug 29 17:28:04 2001 Jonathan Blandford + + * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): + change color when the GtkTreeView loses focus. + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): + ditto. + + * gtk/gtkstyle.c (gtk_default_draw_flat_box): ditto + 2001-08-28 Havoc Pennington * gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c index 6cd6347e44..fbb39e59f1 100644 --- a/gtk/gtkcellrenderertext.c +++ b/gtk/gtkcellrenderertext.c @@ -1225,9 +1225,16 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell, gtk_cell_renderer_text_get_size (cell, widget, cell_area, &x_offset, &y_offset, NULL, NULL); if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) - state = GTK_STATE_SELECTED; + { + if (GTK_WIDGET_HAS_FOCUS (widget)) + state = GTK_STATE_SELECTED; + else + state = GTK_STATE_ACTIVE; + } else - state = GTK_STATE_NORMAL; + { + state = GTK_STATE_NORMAL; + } if (celltext->background_set && state != GTK_STATE_SELECTED) { diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c index f80e9f5f66..d506f55723 100644 --- a/gtk/gtkcellrenderertoggle.c +++ b/gtk/gtkcellrenderertoggle.c @@ -279,11 +279,24 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell, shadow = celltoggle->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT; if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) - state = GTK_STATE_SELECTED; + { + if (GTK_WIDGET_HAS_FOCUS (widget)) + { + state = GTK_STATE_SELECTED; + } + else + { + state = GTK_STATE_ACTIVE; + } + } else if (! cell->can_activate) - state = GTK_STATE_INSENSITIVE; + { + state = GTK_STATE_INSENSITIVE; + } else - state = GTK_STATE_NORMAL; + { + state = GTK_STATE_NORMAL; + } if (celltoggle->radio) { diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index d043663f85..89abbe191f 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -2946,13 +2946,16 @@ gtk_default_draw_flat_box (GtkStyle *style, { if (!strcmp ("text", detail)) gc1 = style->bg_gc[GTK_STATE_SELECTED]; - else if (!strcmp ("cell_even_sorted", detail) || - !strcmp ("cell_odd_sorted", detail) || - !strcmp ("cell_even_ruled_sorted", detail) || - !strcmp ("cell_odd_ruled_sorted", detail)) + else if (!strncmp ("cell_even", detail, strlen ("cell_even")) || + !strncmp ("cell_odd", detail, strlen ("cell_odd"))) { - freeme = get_darkened_gc (window, &style->bg[state_type], 1); - gc1 = freeme; + /* This has to be really broken; alex made me do it. -jrb */ + /* Red rum!!! REd RUM!!! */ + if (GTK_WIDGET_HAS_FOCUS (widget)) + gc1 = style->bg_gc[state_type]; + else + gc1 = style->bg_gc[GTK_STATE_ACTIVE]; + } else { @@ -2978,14 +2981,14 @@ gtk_default_draw_flat_box (GtkStyle *style, !strcmp ("cell_odd", detail) || !strcmp ("cell_even_ruled", detail)) { - gc1 = style->base_gc[state_type]; + gc1 = style->base_gc[state_type]; } else if (!strcmp ("cell_even_sorted", detail) || !strcmp ("cell_odd_sorted", detail) || !strcmp ("cell_odd_ruled", detail) || !strcmp ("cell_even_ruled_sorted", detail)) { - freeme = get_darkened_gc (window, &style->base[state_type], 1); + freeme = get_darkened_gc (window, &style->base[state_type], 1); gc1 = freeme; } else if (!strcmp ("cell_odd_ruled_sorted", detail)) diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 42cedc9511..150c166bc7 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2560,6 +2560,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget, { GtkTreeViewColumn *column = list->data; const gchar *detail = NULL; + GtkStateType state; if (!column->visible) continue; @@ -2635,11 +2636,15 @@ gtk_tree_view_bin_expose (GtkWidget *widget, g_assert (detail); + if (flags & GTK_CELL_RENDERER_SELECTED) + state = GTK_STATE_SELECTED; + else + state = GTK_STATE_NORMAL; + /* Draw background */ gtk_paint_flat_box (widget->style, event->window, - (flags & GTK_CELL_RENDERER_SELECTED) ? - GTK_STATE_SELECTED : GTK_STATE_NORMAL, + state, GTK_SHADOW_NONE, &event->area, widget,