mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
Add a default handler for drag_failed
And use it in notebook dnd.
This commit is contained in:
parent
e6693ab840
commit
9baf24f87e
@ -371,8 +371,7 @@ static void gtk_notebook_drag_end (GtkWidget *widget,
|
||||
GdkDragContext *context);
|
||||
static gboolean gtk_notebook_drag_failed (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkDragResult result,
|
||||
gpointer data);
|
||||
GtkDragResult result);
|
||||
static gboolean gtk_notebook_drag_motion (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
@ -665,6 +664,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
||||
widget_class->drag_drop = gtk_notebook_drag_drop;
|
||||
widget_class->drag_data_get = gtk_notebook_drag_data_get;
|
||||
widget_class->drag_data_received = gtk_notebook_drag_data_received;
|
||||
widget_class->drag_failed = gtk_notebook_drag_failed;
|
||||
widget_class->compute_expand = gtk_notebook_compute_expand;
|
||||
|
||||
container_class->add = gtk_notebook_add;
|
||||
@ -1202,9 +1202,6 @@ gtk_notebook_init (GtkNotebook *notebook)
|
||||
notebook_targets, G_N_ELEMENTS (notebook_targets),
|
||||
GDK_ACTION_MOVE);
|
||||
|
||||
g_signal_connect (G_OBJECT (notebook), "drag-failed",
|
||||
G_CALLBACK (gtk_notebook_drag_failed), NULL);
|
||||
|
||||
gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
|
||||
|
||||
context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
|
||||
@ -3588,8 +3585,7 @@ gtk_notebook_create_window (GtkNotebook *notebook,
|
||||
static gboolean
|
||||
gtk_notebook_drag_failed (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkDragResult result,
|
||||
gpointer data)
|
||||
GtkDragResult result)
|
||||
{
|
||||
if (result == GTK_DRAG_RESULT_NO_TARGET)
|
||||
{
|
||||
|
@ -2455,7 +2455,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
|
||||
g_signal_new (I_("drag-failed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, _gtk_boolean_handled_accumulator, NULL,
|
||||
G_STRUCT_OFFSET (GtkWidgetClass, drag_failed),
|
||||
_gtk_boolean_handled_accumulator, NULL,
|
||||
_gtk_marshal_BOOLEAN__OBJECT_ENUM,
|
||||
G_TYPE_BOOLEAN, 2,
|
||||
GDK_TYPE_DRAG_CONTEXT,
|
||||
|
@ -375,6 +375,9 @@ struct _GtkWidgetClass
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
guint time_);
|
||||
gboolean (* drag_failed) (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkDragResult result);
|
||||
|
||||
/* Signals used only for keybindings */
|
||||
gboolean (* popup_menu) (GtkWidget *widget);
|
||||
|
Loading…
Reference in New Issue
Block a user