Commit 97d99169 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

change color when the GtkTreeView loses focus.

Wed Aug 29 17:28:04 2001  Jonathan Blandford  <jrb@redhat.com>

	* 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
parent aa4298ee
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
Wed Aug 29 17:28:04 2001 Jonathan Blandford <jrb@redhat.com>
* 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 <hp@pobox.com>
* gtk/gtkwindow.c (gtk_window_set_icon_list): fix g_object_notify
......
......@@ -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)
{
......
......@@ -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)
{
......
......@@ -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))
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment