Invalidate the window if the tree is empty, to avoid resizing artifacts

2004-10-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate
	the window if the tree is empty, to avoid resizing artifacts
	from the focus rectangle.  (#155881, Vincent Noel, patch by
	Billy Biggs)
This commit is contained in:
Matthias Clasen 2004-10-24 00:43:48 +00:00 committed by Matthias Clasen
parent c50d0e0599
commit ff9e1e7ac4
5 changed files with 49 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2004-10-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate
the window if the tree is empty, to avoid resizing artifacts
from the focus rectangle. (#155881, Vincent Noel, patch by
Billy Biggs)
Sat Oct 23 16:14:37 2004 Søren Sandmann <sandmann@redhat.com>
* gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove

View File

@ -1,3 +1,10 @@
2004-10-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate
the window if the tree is empty, to avoid resizing artifacts
from the focus rectangle. (#155881, Vincent Noel, patch by
Billy Biggs)
Sat Oct 23 16:14:37 2004 Søren Sandmann <sandmann@redhat.com>
* gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove

View File

@ -1,3 +1,10 @@
2004-10-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate
the window if the tree is empty, to avoid resizing artifacts
from the focus rectangle. (#155881, Vincent Noel, patch by
Billy Biggs)
Sat Oct 23 16:14:37 2004 Søren Sandmann <sandmann@redhat.com>
* gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove

View File

@ -1,3 +1,10 @@
2004-10-23 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate
the window if the tree is empty, to avoid resizing artifacts
from the focus rectangle. (#155881, Vincent Noel, patch by
Billy Biggs)
Sat Oct 23 16:14:37 2004 Søren Sandmann <sandmann@redhat.com>
* gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove

View File

@ -288,7 +288,7 @@ static void install_presize_handler (GtkTreeView *tree_view);
static void install_scroll_sync_handler (GtkTreeView *tree_view);
static void gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view);
static void gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view);
static void invalidate_empty_focus (GtkTreeView *tree_view);
/* Internal functions */
static gboolean gtk_tree_view_is_expander_column (GtkTreeView *tree_view,
@ -2109,6 +2109,9 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
gtk_tree_view_size_allocate_columns (widget);
if (tree_view->priv->tree == NULL)
invalidate_empty_focus (tree_view);
if (GTK_WIDGET_REALIZED (widget))
{
gboolean has_expand_column = FALSE;
@ -3353,6 +3356,23 @@ gtk_tree_view_motion (GtkWidget *widget,
return FALSE;
}
/* Invalidate the focus rectangle near the edge of the bin_window; used when
* the tree is empty.
*/
static void
invalidate_empty_focus (GtkTreeView *tree_view)
{
GdkRectangle area;
if (!GTK_WIDGET_HAS_FOCUS (tree_view))
return;
area.x = 0;
area.y = 0;
gdk_drawable_get_size (tree_view->priv->bin_window, &area.width, &area.height);
gdk_window_invalidate_rect (tree_view->priv->bin_window, &area, FALSE);
}
/* Draws a focus rectangle near the edge of the bin_window; used when the tree
* is empty.
*/