1999-03-08 Federico Mena Quintero <federico@nuclecu.unam.mx>

* gscreen.c (can_drop_on_clist): New function to figure out if the
	user is trying to drop on a valid region of a GtkCList.  It sucks
	to have to poke into its internal geometry, though.
This commit is contained in:
Miguel de Icaza 1999-03-09 00:13:07 +00:00
parent 0cdbdafd7f
commit f3a438eae3
2 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,9 @@
1999-03-08 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gscreen.c (can_drop_on_clist): New function to figure out if the
user is trying to drop on a valid region of a GtkCList. It sucks
to have to poke into its internal geometry, though.
1999-03-08 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-03-08 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gnome-file-property-dialog.c (apply_metadata_change): only set * gnome-file-property-dialog.c (apply_metadata_change): only set

View File

@ -1089,6 +1089,25 @@ panel_clist_scroll (gpointer data)
return TRUE; return TRUE;
} }
/* Convenience function to return whether we are on a valid drop area in a
* GtkCList.
*/
static int
can_drop_on_clist (WPanel *panel, int x, int y)
{
GtkCList *clist;
int border_width;
clist = CLIST_FROM_SW (panel->list);
border_width = GTK_CONTAINER (clist)->border_width;
if (y < border_width + clist->column_title_area.y + clist->column_title_area.height)
return FALSE;
else
return TRUE;
}
/* Callback used for drag motion events over the clist. We set up /* Callback used for drag motion events over the clist. We set up
* auto-scrolling and validate the drop to present the user with the correct * auto-scrolling and validate the drop to present the user with the correct
* feedback. * feedback.
@ -1105,8 +1124,7 @@ panel_clist_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gin
panel = data; panel = data;
if (context->dest_window != GTK_CLIST (widget)->clist_window) { if (!can_drop_on_clist (panel, x, y)) {
printf ("squick\n");
gdk_drag_status (context, 0, time); gdk_drag_status (context, 0, time);
return TRUE; return TRUE;
} }