diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c index ba062e71a7..b8fc1f75ff 100644 --- a/docs/tools/widgets.c +++ b/docs/tools/widgets.c @@ -425,10 +425,10 @@ create_action_bar (void) widget = gtk_action_bar_new (); - button = gtk_button_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_MENU); + button = gtk_button_new_from_icon_name ("object-select-symbolic"); gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (widget), button); - button = gtk_button_new_from_icon_name ("call-start-symbolic", GTK_ICON_SIZE_MENU); + button = gtk_button_new_from_icon_name ("call-start-symbolic"); gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (widget), button); g_object_set (gtk_widget_get_parent (button), "margin", 6, "spacing", 6, NULL); diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index eb2958cac2..b66e8971a9 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -614,7 +614,6 @@ gtk_button_new_with_label (const gchar *label) /** * gtk_button_new_from_icon_name: * @icon_name: (nullable): an icon name or %NULL - * @size: (type int): an icon size (#GtkIconSize) * * Creates a new button containing an icon from the current icon theme. * @@ -627,15 +626,13 @@ gtk_button_new_with_label (const gchar *label) * Since: 3.10 */ GtkWidget* -gtk_button_new_from_icon_name (const gchar *icon_name, - GtkIconSize size) +gtk_button_new_from_icon_name (const gchar *icon_name) { GtkWidget *button; - GtkWidget *image; - image = gtk_image_new_from_icon_name (icon_name, size); - button = g_object_new (GTK_TYPE_BUTTON, NULL); - gtk_container_add (GTK_CONTAINER (button), image); + button = g_object_new (GTK_TYPE_BUTTON, + "icon-name", icon_name, + NULL); return button; } diff --git a/gtk/gtkbutton.h b/gtk/gtkbutton.h index d62c49c380..2bd236c417 100644 --- a/gtk/gtkbutton.h +++ b/gtk/gtkbutton.h @@ -89,8 +89,7 @@ GtkWidget* gtk_button_new (void); GDK_AVAILABLE_IN_ALL GtkWidget* gtk_button_new_with_label (const gchar *label); GDK_AVAILABLE_IN_3_10 -GtkWidget* gtk_button_new_from_icon_name (const gchar *icon_name, - GtkIconSize size); +GtkWidget* gtk_button_new_from_icon_name (const gchar *icon_name); GDK_AVAILABLE_IN_ALL GtkWidget* gtk_button_new_with_mnemonic (const gchar *label); GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 2cd6c2889b..7210916bf3 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -884,7 +884,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) g_signal_connect (priv->entry, "activate", G_CALLBACK (gtk_spin_button_activate), spin_button); gtk_container_add (GTK_CONTAINER (priv->box), priv->entry); - priv->down_button = gtk_button_new_from_icon_name ("list-remove-symbolic", GTK_ICON_SIZE_BUTTON); + priv->down_button = gtk_button_new_from_icon_name ("list-remove-symbolic"); gtk_widget_set_can_focus (priv->down_button, FALSE); gtk_style_context_add_class (gtk_widget_get_style_context (priv->down_button), "down"); gtk_container_add (GTK_CONTAINER (priv->box), priv->down_button); @@ -897,7 +897,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) g_signal_connect (priv->down_click_gesture, "pressed", G_CALLBACK (button_pressed_cb), spin_button); g_signal_connect (priv->down_click_gesture, "released", G_CALLBACK (button_released_cb), spin_button); - priv->up_button = gtk_button_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON); + priv->up_button = gtk_button_new_from_icon_name ("list-add-symbolic"); gtk_widget_set_can_focus (priv->up_button, FALSE); gtk_style_context_add_class (gtk_widget_get_style_context (priv->up_button), "up"); gtk_container_add (GTK_CONTAINER (priv->box), priv->up_button); diff --git a/gtk/inspector/strv-editor.c b/gtk/inspector/strv-editor.c index 0ea973bc0c..cc5fad6d35 100644 --- a/gtk/inspector/strv-editor.c +++ b/gtk/inspector/strv-editor.c @@ -72,7 +72,7 @@ add_string (GtkInspectorStrvEditor *editor, g_object_set_data (G_OBJECT (box), "entry", entry); g_signal_connect_swapped (entry, "notify::text", G_CALLBACK (emit_changed), editor); - button = gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU); + button = gtk_button_new_from_icon_name ("user-trash-symbolic"); gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button"); gtk_widget_show (button); gtk_box_pack_start (GTK_BOX (box), button); @@ -100,7 +100,7 @@ gtk_inspector_strv_editor_init (GtkInspectorStrvEditor *editor) editor->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_widget_show (editor->box); - editor->button = gtk_button_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_MENU); + editor->button = gtk_button_new_from_icon_name ("list-add-symbolic"); gtk_style_context_add_class (gtk_widget_get_style_context (editor->button), "image-button"); gtk_widget_set_focus_on_click (editor->button, FALSE); gtk_widget_set_halign (editor->button, GTK_ALIGN_END); diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index e7711847f2..655b360f3e 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -202,8 +202,7 @@ gtk_inspector_window_init (GtkInspectorWindow *iw) if (use_picker) { - button = gtk_button_new_from_icon_name ("find-location-symbolic", - GTK_ICON_SIZE_MENU); + button = gtk_button_new_from_icon_name ("find-location-symbolic"); gtk_widget_set_focus_on_click (button, FALSE); gtk_widget_set_halign (button, GTK_ALIGN_START); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); diff --git a/tests/testbuttons.c b/tests/testbuttons.c index d597e4be2c..038dfade80 100644 --- a/tests/testbuttons.c +++ b/tests/testbuttons.c @@ -84,7 +84,7 @@ int main (int argc, char *argv[]) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (box), hbox); - button = gtk_button_new_from_icon_name ("help-about", GTK_ICON_SIZE_BUTTON); + button = gtk_button_new_from_icon_name ("help-about"); gtk_container_add (GTK_CONTAINER (hbox), button); g_object_get (button, diff --git a/tests/testnotebookdnd.c b/tests/testnotebookdnd.c index 3bda059c86..add1dcd0d2 100644 --- a/tests/testnotebookdnd.c +++ b/tests/testnotebookdnd.c @@ -179,7 +179,7 @@ create_notebook (gchar **labels, gtk_widget_set_vexpand (notebook, TRUE); gtk_widget_set_hexpand (notebook, TRUE); - action_widget = gtk_button_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON); + action_widget = gtk_button_new_from_icon_name ("list-add-symbolic"); g_signal_connect (action_widget, "clicked", G_CALLBACK (action_clicked_cb), notebook); gtk_widget_show (action_widget); gtk_notebook_set_action_widget (GTK_NOTEBOOK (notebook), action_widget, GTK_PACK_END); @@ -223,7 +223,7 @@ create_notebook_non_dragable_content (gchar **labels, gtk_widget_set_vexpand (notebook, TRUE); gtk_widget_set_hexpand (notebook, TRUE); - action_widget = gtk_button_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON); + action_widget = gtk_button_new_from_icon_name ("list-add-symbolic"); g_signal_connect (action_widget, "clicked", G_CALLBACK (action_clicked_cb), notebook); gtk_widget_show (action_widget); gtk_notebook_set_action_widget (GTK_NOTEBOOK (notebook), action_widget, GTK_PACK_END); diff --git a/tests/testtoolbar2.c b/tests/testtoolbar2.c index 499edb8b0c..4b1b24e0fd 100644 --- a/tests/testtoolbar2.c +++ b/tests/testtoolbar2.c @@ -23,11 +23,11 @@ int main (int argc, char *argv[]) box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); g_object_set (box3, "margin", 10, NULL); gtk_style_context_add_class (gtk_widget_get_style_context (box3), GTK_STYLE_CLASS_LINKED); - button = gtk_button_new_from_icon_name ("document-new-symbolic", GTK_ICON_SIZE_BUTTON); + button = gtk_button_new_from_icon_name ("document-new-symbolic"); gtk_container_add (GTK_CONTAINER (box3), button); - button = gtk_button_new_from_icon_name ("document-open-symbolic", GTK_ICON_SIZE_BUTTON); + button = gtk_button_new_from_icon_name ("document-open-symbolic"); gtk_container_add (GTK_CONTAINER (box3), button); - button = gtk_button_new_from_icon_name ("document-save-symbolic", GTK_ICON_SIZE_BUTTON); + button = gtk_button_new_from_icon_name ("document-save-symbolic"); gtk_container_add (GTK_CONTAINER (box3), button); gtk_container_add (GTK_CONTAINER (frame), box3);