diff --git a/ChangeLog b/ChangeLog index 662d56a517..0b69b6498f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-03-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor): + Put the trash icon on the right for LTR locales, or on the left + for RTL. + (shortcuts_drag_motion_cb): Cancel the idle handler here as well. + (shortcuts_drag_leave_cb): Test whether the idle is present. + Thu Mar 11 17:51:10 2004 Owen Taylor * modules/input/gtkimcontextxim.c (preedit_done_callback): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 662d56a517..0b69b6498f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2004-03-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor): + Put the trash icon on the right for LTR locales, or on the left + for RTL. + (shortcuts_drag_motion_cb): Cancel the idle handler here as well. + (shortcuts_drag_leave_cb): Test whether the idle is present. + Thu Mar 11 17:51:10 2004 Owen Taylor * modules/input/gtkimcontextxim.c (preedit_done_callback): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 662d56a517..0b69b6498f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2004-03-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor): + Put the trash icon on the right for LTR locales, or on the left + for RTL. + (shortcuts_drag_motion_cb): Cancel the idle handler here as well. + (shortcuts_drag_leave_cb): Test whether the idle is present. + Thu Mar 11 17:51:10 2004 Owen Taylor * modules/input/gtkimcontextxim.c (preedit_done_callback): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 662d56a517..0b69b6498f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2004-03-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor): + Put the trash icon on the right for LTR locales, or on the left + for RTL. + (shortcuts_drag_motion_cb): Cancel the idle handler here as well. + (shortcuts_drag_leave_cb): Test whether the idle is present. + Thu Mar 11 17:51:10 2004 Owen Taylor * modules/input/gtkimcontextxim.c (preedit_done_callback): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 662d56a517..0b69b6498f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2004-03-11 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor): + Put the trash icon on the right for LTR locales, or on the left + for RTL. + (shortcuts_drag_motion_cb): Cancel the idle handler here as well. + (shortcuts_drag_leave_cb): Test whether the idle is present. + Thu Mar 11 17:51:10 2004 Owen Taylor * modules/input/gtkimcontextxim.c (preedit_done_callback): diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index b89a12aa32..d25577781f 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1881,7 +1881,7 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl, int row_pixmap_width, row_pixmap_height; int pixbuf_width, pixbuf_height; int composite_width, composite_height; - int pixbuf_y; + int pixbuf_x, pixbuf_y; GdkGC *gc, *mask_gc; GdkColor color; GdkBitmap *pixbuf_mask; @@ -1896,6 +1896,12 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl, composite_height = MAX (row_pixmap_height, pixbuf_height); row_pixmap_y = (composite_height - row_pixmap_height) / 2; + + if (gtk_widget_get_direction (impl->browse_shortcuts_tree_view) == GTK_TEXT_DIR_RTL) + pixbuf_x = 0; + else + pixbuf_x = composite_width - pixbuf_width; + pixbuf_y = (composite_height - pixbuf_height) / 2; composite = gdk_pixmap_new (row_pixmap, composite_width, composite_height, -1); @@ -1921,7 +1927,7 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl, NULL, &pixbuf_mask, 128); gdk_draw_drawable (mask, mask_gc, pixbuf_mask, 0, 0, - 0, pixbuf_y, + pixbuf_x, pixbuf_y, pixbuf_width, pixbuf_height); g_object_unref (pixbuf_mask); @@ -1935,7 +1941,7 @@ shortcuts_drag_set_delete_cursor (GtkFileChooserDefault *impl, gdk_draw_pixbuf (composite, gc, pixbuf, 0, 0, - 0, pixbuf_y, + pixbuf_x, pixbuf_y, pixbuf_width, pixbuf_height, GDK_RGB_DITHER_MAX, 0, 0); @@ -1993,10 +1999,8 @@ shortcuts_drag_leave_cb (GtkWidget *widget, guint time_, GtkFileChooserDefault *impl) { - if (gtk_drag_get_source_widget (context) == widget) + if (gtk_drag_get_source_widget (context) == widget && !impl->shortcuts_drag_outside_idle) { - g_assert (impl->shortcuts_drag_outside_idle == NULL); - impl->shortcuts_drag_outside_idle = g_idle_source_new (); g_source_set_closure (impl->shortcuts_drag_outside_idle, g_cclosure_new_object (G_CALLBACK (shortcuts_drag_outside_idle_cb), @@ -2085,12 +2089,15 @@ shortcuts_drag_motion_cb (GtkWidget *widget, GtkTreeViewDropPosition pos; GdkDragAction action; - if (gtk_drag_get_source_widget (context) == widget && impl->shortcuts_drag_outside) + if (gtk_drag_get_source_widget (context) == widget) { - g_assert (impl->shortcuts_drag_outside_idle == NULL); + shortcuts_cancel_drag_outside_idle (impl); - shortcuts_drag_set_delete_cursor (impl, FALSE); - impl->shortcuts_drag_outside = FALSE; + if (impl->shortcuts_drag_outside) + { + shortcuts_drag_set_delete_cursor (impl, FALSE); + impl->shortcuts_drag_outside = FALSE; + } } if (context->suggested_action == GDK_ACTION_COPY || (context->actions & GDK_ACTION_COPY) != 0) @@ -2277,6 +2284,7 @@ shortcuts_drag_data_received_cb (GtkWidget *widget, int bookmarks_index; impl = GTK_FILE_CHOOSER_DEFAULT (data); + g_assert (impl->shortcuts_drag_outside_idle == NULL); /* Compute position */