From 19c5e80ce770d164afc3b2682f02e69e0899cceb Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Mon, 21 Jan 2002 17:38:28 +0000 Subject: [PATCH] only resize the window. Fri Jan 18 16:31:21 2002 Jonathan Blandford * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the window. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtktreeview.c | 8 ++++---- gtk/gtktreeviewcolumn.c | 22 +++++++++++----------- 9 files changed, 50 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5d3fdf389e..164a6f104c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri Jan 18 16:31:21 2002 Jonathan Blandford + + * gtk/gtktreeview.c (gtk_tree_view_size_allocate): only resize the + window. + Mon Jan 21 11:56:31 2002 Owen Taylor * gtk/gtkentry.c (gtk_entry_real_activate): Trap the diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index eff44c82a7..47c132690c 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1581,10 +1581,9 @@ gtk_tree_view_size_allocate (GtkWidget *widget, gdk_window_resize (tree_view->priv->header_window, MAX (tree_view->priv->width, allocation->width), tree_view->priv->header_height); - gdk_window_move_resize (tree_view->priv->bin_window, - 0, TREE_VIEW_HEADER_HEIGHT (tree_view), - MAX (tree_view->priv->width, allocation->width), - allocation->height - TREE_VIEW_HEADER_HEIGHT (tree_view)); + gdk_window_resize (tree_view->priv->bin_window, + MAX (tree_view->priv->width, allocation->width), + allocation->height - TREE_VIEW_HEADER_HEIGHT (tree_view)); } gtk_tree_view_size_allocate_columns (widget); @@ -5757,6 +5756,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gint x, y, width, height; g_return_if_fail (tree_view->priv->column_drag_info == NULL); + g_print ("start drag!\n"); gtk_tree_view_set_column_drag_info (tree_view, column); diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 870c16ae74..75b743a341 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -92,8 +92,6 @@ static void gtk_tree_view_column_update_button (GtkTreeViewColum static gint gtk_tree_view_column_button_event (GtkWidget *widget, GdkEvent *event, gpointer data); -static void gtk_tree_view_column_button_realize (GtkWidget *widget, - gpointer data); static void gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data); @@ -530,6 +528,7 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column) gtk_widget_push_composite_child (); tree_column->button = gtk_button_new (); + gtk_widget_add_events (tree_column->button, GDK_POINTER_MOTION_MASK); gtk_widget_pop_composite_child (); /* make sure we own a reference to it as well. */ @@ -537,10 +536,6 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column) gtk_widget_set_parent_window (tree_column->button, tree_view->priv->header_window); gtk_widget_set_parent (tree_column->button, GTK_WIDGET (tree_view)); - gtk_signal_connect (GTK_OBJECT (tree_column->button), "realize", - (GtkSignalFunc) gtk_tree_view_column_button_realize, - NULL); - gtk_signal_connect (GTK_OBJECT (tree_column->button), "event", (GtkSignalFunc) gtk_tree_view_column_button_event, (gpointer) tree_column); @@ -743,9 +738,12 @@ gtk_tree_view_column_button_event (GtkWidget *widget, g_return_val_if_fail (event != NULL, FALSE); + g_print ("event->type: %d\ncolumn->reorderable: %d\n", event->type, column->reorderable); + if (event->type == GDK_BUTTON_PRESS && column->reorderable) { + g_print ("setting maybe_reordered\n"); column->maybe_reordered = TRUE; gdk_window_get_pointer (widget->window, &column->drag_x, @@ -758,6 +756,13 @@ gtk_tree_view_column_button_event (GtkWidget *widget, column->maybe_reordered) column->maybe_reordered = FALSE; + + if (event->type == GDK_MOTION_NOTIFY && + (column->maybe_reordered)) + { + g_print ("motion:\n"); + } + if (event->type == GDK_MOTION_NOTIFY && (column->maybe_reordered) && (gtk_drag_check_threshold (widget, @@ -789,11 +794,6 @@ gtk_tree_view_column_button_event (GtkWidget *widget, return FALSE; } -static void -gtk_tree_view_column_button_realize (GtkWidget *widget, gpointer data) -{ - gdk_window_set_events (widget->window, gdk_window_get_events (widget->window) | GDK_POINTER_MOTION_MASK); -} static void gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)