Fixes #75745, reported by Richard Hult. Merged from stable.

Thu May 29 15:38:30 2003  Kristian Rietveld  <kris@gtk.org>

	Fixes #75745, reported by Richard Hult. Merged from stable.

	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): set/unset
	GTK_CELL_RENDERER_FOCUSED flag whether the current node is the
	cursor or not.

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
	if we are rendering a cursor row, and the cell the be
	processed has focus, then set the GTK_CELL_RENDERER_FOCUSED
	flag (else we unset it).
This commit is contained in:
Kristian Rietveld 2003-05-29 13:47:32 +00:00 committed by Kristian Rietveld
parent 83c626bbe0
commit c378989102
7 changed files with 79 additions and 2 deletions

View File

@ -1,3 +1,16 @@
Thu May 29 15:38:30 2003 Kristian Rietveld <kris@gtk.org>
Fixes #75745, reported by Richard Hult. Merged from stable.
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): set/unset
GTK_CELL_RENDERER_FOCUSED flag whether the current node is the
cursor or not.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
if we are rendering a cursor row, and the cell the be
processed has focus, then set the GTK_CELL_RENDERER_FOCUSED
flag (else we unset it).
2003-05-27 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow-decorate.c:

View File

@ -1,3 +1,16 @@
Thu May 29 15:38:30 2003 Kristian Rietveld <kris@gtk.org>
Fixes #75745, reported by Richard Hult. Merged from stable.
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): set/unset
GTK_CELL_RENDERER_FOCUSED flag whether the current node is the
cursor or not.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
if we are rendering a cursor row, and the cell the be
processed has focus, then set the GTK_CELL_RENDERER_FOCUSED
flag (else we unset it).
2003-05-27 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow-decorate.c:

View File

@ -1,3 +1,16 @@
Thu May 29 15:38:30 2003 Kristian Rietveld <kris@gtk.org>
Fixes #75745, reported by Richard Hult. Merged from stable.
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): set/unset
GTK_CELL_RENDERER_FOCUSED flag whether the current node is the
cursor or not.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
if we are rendering a cursor row, and the cell the be
processed has focus, then set the GTK_CELL_RENDERER_FOCUSED
flag (else we unset it).
2003-05-27 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow-decorate.c:

View File

@ -1,3 +1,16 @@
Thu May 29 15:38:30 2003 Kristian Rietveld <kris@gtk.org>
Fixes #75745, reported by Richard Hult. Merged from stable.
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): set/unset
GTK_CELL_RENDERER_FOCUSED flag whether the current node is the
cursor or not.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
if we are rendering a cursor row, and the cell the be
processed has focus, then set the GTK_CELL_RENDERER_FOCUSED
flag (else we unset it).
2003-05-27 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow-decorate.c:

View File

@ -1,3 +1,16 @@
Thu May 29 15:38:30 2003 Kristian Rietveld <kris@gtk.org>
Fixes #75745, reported by Richard Hult. Merged from stable.
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): set/unset
GTK_CELL_RENDERER_FOCUSED flag whether the current node is the
cursor or not.
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
if we are rendering a cursor row, and the cell the be
processed has focus, then set the GTK_CELL_RENDERER_FOCUSED
flag (else we unset it).
2003-05-27 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow-decorate.c:

View File

@ -3095,6 +3095,11 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
else
flags &= ~GTK_CELL_RENDERER_SORTED;
if (cursor == node)
flags |= GTK_CELL_RENDERER_FOCUSED;
else
flags &= ~GTK_CELL_RENDERER_FOCUSED;
background_area.x = cell_offset;
background_area.width = column->width;

View File

@ -2484,6 +2484,7 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column,
gint focus_line_width;
gint dx;
gint special_cells;
gboolean cursor_row = FALSE;
gboolean rtl;
/* If we have rtl text, we need to transform our areas */
GdkRectangle rtl_cell_area;
@ -2521,6 +2522,8 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column,
}
}
cursor_row = flags & GTK_CELL_RENDERER_FOCUSED;
gtk_widget_style_get (GTK_WIDGET (tree_column->tree_view),
"focus-line-width", &focus_line_width,
NULL);
@ -2562,8 +2565,10 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column,
if (! info->cell->visible)
continue;
if (info->has_focus)
if ((info->has_focus || special_cells == 1) && cursor_row)
flags |= GTK_CELL_RENDERER_FOCUSED;
else
flags &= ~GTK_CELL_RENDERER_FOCUSED;
real_background_area.width = info->requested_width +
(info->expand?extra_space:0);
@ -2715,8 +2720,10 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column,
if (! info->cell->visible)
continue;
if (info->has_focus)
if ((info->has_focus || special_cells == 1) && cursor_row)
flags |= GTK_CELL_RENDERER_FOCUSED;
else
flags &= ~GTK_CELL_RENDERER_FOCUSED;
real_background_area.width = info->requested_width +
(info->expand?extra_space:0);