diff options
-rw-r--r-- | docs/tools/widgets.c | 4 | ||||
-rw-r--r-- | gtk/gtkbutton.c | 12 | ||||
-rw-r--r-- | gtk/gtkbutton.h | 3 | ||||
-rw-r--r-- | gtk/gtkspinbutton.c | 4 | ||||
-rw-r--r-- | gtk/inspector/strv-editor.c | 4 | ||||
-rw-r--r-- | gtk/inspector/window.c | 3 | ||||
-rw-r--r-- | tests/testbuttons.c | 2 | ||||
-rw-r--r-- | tests/testnotebookdnd.c | 4 | ||||
-rw-r--r-- | tests/testtoolbar2.c | 6 |
9 files changed, 18 insertions, 24 deletions
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c index 412fa9bfeb..5c08c493c7 100644 --- a/docs/tools/widgets.c +++ b/docs/tools/widgets.c @@ -428,10 +428,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 448650dfc6..1cefee5e2f 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -662,7 +662,6 @@ gtk_button_new_with_label (const gchar *label) /** * gtk_button_new_from_icon_name: * @icon_name: an icon name - * @size: (type int): an icon size (#GtkIconSize) * * Creates a new button containing an icon from the current icon theme. * @@ -675,16 +674,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_widget_show (image); - 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 4fbb655ec6..05af6dd1f3 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -849,7 +849,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) -1, gtk_entry_get_gadget (GTK_ENTRY (spin_button)), TRUE, GTK_ALIGN_FILL); - 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_widget_set_parent (priv->down_button, GTK_WIDGET (spin_button)); @@ -862,7 +862,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_widget_set_parent (priv->up_button, GTK_WIDGET (spin_button)); diff --git a/gtk/inspector/strv-editor.c b/gtk/inspector/strv-editor.c index 3add2e36b8..cc54091501 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, FALSE, FALSE); @@ -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 beb44f9025..2bf52e9dfe 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 6c58cb3b70..2691662a8f 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 6ee3cfbbf0..3342c3d1bc 100644 --- a/tests/testnotebookdnd.c +++ b/tests/testnotebookdnd.c @@ -178,7 +178,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); @@ -222,7 +222,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 878f43aff1..9f7bfba2dc 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); |