gtk: Stop using gtk_button_clicked

This function is going away.
This commit is contained in:
Matthias Clasen 2019-05-18 18:15:54 +00:00
parent 6e2df85ec8
commit cf47bb9355
8 changed files with 17 additions and 12 deletions

View File

@ -236,7 +236,7 @@ gtk_button_accessible_do_action (AtkAction *action,
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
gtk_button_clicked (GTK_BUTTON (widget));
g_signal_emit_by_name (widget, "clicked");
return TRUE;
}

View File

@ -126,7 +126,7 @@ gtk_link_button_accessible_link_do_action (AtkAction *action,
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
gtk_button_clicked (GTK_BUTTON (widget));
g_signal_emit_by_name (widget, "clicked");
return TRUE;
}

View File

@ -739,7 +739,7 @@ gtk_button_do_release (GtkButton *button,
return;
if (emit_clicked)
gtk_button_clicked (button);
g_signal_emit (button, button_signals[CLICKED], 0);
}
}
@ -786,7 +786,7 @@ gtk_button_finish_activate (GtkButton *button,
priv->button_down = FALSE;
if (do_it)
gtk_button_clicked (button);
g_signal_emit (button, button_signals[CLICKED], 0);
}
/**

View File

@ -760,7 +760,7 @@ gtk_radio_button_clicked (GtkButton *button)
if (gtk_toggle_button_get_active (tmp_button) && (tmp_button != toggle_button))
{
gtk_button_clicked (GTK_BUTTON (tmp_button));
g_signal_emit_by_name (tmp_button, "clicked");
break;
}
}

View File

@ -308,7 +308,7 @@ gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
if (priv->active != is_active)
{
gtk_button_clicked (GTK_BUTTON (toggle_button));
g_signal_emit_by_name (toggle_button, "clicked");
g_object_notify_by_pspec (G_OBJECT (toggle_button), toggle_button_props[PROP_ACTIVE]);
}
}

View File

@ -340,7 +340,7 @@ gtk_toggle_tool_button_set_active (GtkToggleToolButton *button,
if (button->priv->active != is_active)
{
gtk_button_clicked (GTK_BUTTON (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button))));
g_signal_emit_by_name (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button)), "clicked");
g_object_notify (G_OBJECT (button), "active");
}
}

View File

@ -727,6 +727,12 @@ clone_image_menu_size (GtkImage *image)
return NULL;
}
static void
click_button (GtkButton *button)
{
g_signal_emit_by_name (button, "clicked");
}
static gboolean
gtk_tool_button_create_menu_proxy (GtkToolItem *item)
{
@ -777,7 +783,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
g_signal_connect_closure_by_id (menu_item,
g_signal_lookup ("activate", G_OBJECT_TYPE (menu_item)), 0,
g_cclosure_new_object_swap (G_CALLBACK (gtk_button_clicked),
g_cclosure_new_object_swap (G_CALLBACK (click_button),
G_OBJECT (GTK_TOOL_BUTTON (button)->priv->button)),
FALSE);

View File

@ -1087,7 +1087,7 @@ gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
_gtk_tree_view_set_focus_column (GTK_TREE_VIEW (priv->tree_view), column);
if (priv->clickable)
gtk_button_clicked (GTK_BUTTON (priv->button));
g_signal_emit_by_name (priv->button, "clicked");
else if (gtk_widget_get_can_focus (priv->button))
gtk_widget_grab_focus (priv->button);
else
@ -2244,9 +2244,8 @@ gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column)
priv = tree_column->priv;
if (priv->visible &&
priv->clickable)
gtk_button_clicked (GTK_BUTTON (priv->button));
if (priv->visible && priv->clickable)
g_signal_emit_by_name (priv->button, "clicked");
}
/**