diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-11-14 19:43:13 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-11-15 14:22:17 -0500 |
commit | dbfaa9910705a35d3017f1e8e65a9cf52e2f7d9b (patch) | |
tree | a76a5be1cac5ef746c431a00e8b79a93b63f3e10 | |
parent | 049cc6aa013601c4e662c38df408f8956b155f0a (diff) | |
download | gtk+-dbfaa9910705a35d3017f1e8e65a9cf52e2f7d9b.tar.gz |
image: Remove icon-size argument from icon setters
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.
Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
56 files changed, 174 insertions, 217 deletions
diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c index 79992da572..986f0fa758 100644 --- a/demos/gtk-demo/clipboard.c +++ b/demos/gtk-demo/clipboard.c @@ -70,6 +70,7 @@ get_image_surface (GtkImage *image) const gchar *icon_name; GtkIconTheme *icon_theme; int width; + GtkIconSize size; switch (gtk_image_get_storage_type (image)) { @@ -77,6 +78,7 @@ get_image_surface (GtkImage *image) return cairo_surface_reference (gtk_image_get_surface (image)); case GTK_IMAGE_ICON_NAME: icon_name = gtk_image_get_icon_name (image); + size = gtk_image_get_icon_size (image); icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image))); gtk_icon_size_lookup (size, &width, NULL); return gtk_icon_theme_load_surface (icon_theme, icon_name, width, 1, NULL, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL); @@ -270,8 +272,7 @@ do_clipboard (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), hbox); /* Create the first image */ - image = gtk_image_new_from_icon_name ("dialog-warning", - GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("dialog-warning"); gtk_container_add (GTK_CONTAINER (hbox), image); /* make image a drag source */ @@ -294,8 +295,7 @@ do_clipboard (GtkWidget *do_widget) G_CALLBACK (button_press), image); /* Create the second image */ - image = gtk_image_new_from_icon_name ("process-stop", - GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("process-stop"); gtk_container_add (GTK_CONTAINER (hbox), image); /* make image a drag source */ diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c index c72b1559bb..fd130d7ba3 100644 --- a/demos/gtk-demo/dialog.c +++ b/demos/gtk-demo/dialog.c @@ -58,7 +58,7 @@ interactive_dialog_clicked (GtkButton *button, hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_box_pack_start (GTK_BOX (content_area), hbox); - image = gtk_image_new_from_icon_name ("dialog-question", GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name ("dialog-question"); gtk_box_pack_start (GTK_BOX (hbox), image); table = gtk_grid_new (); diff --git a/demos/gtk-demo/gtkfishbowl.c b/demos/gtk-demo/gtkfishbowl.c index a41a39c550..cf19ecb3f4 100644 --- a/demos/gtk-demo/gtkfishbowl.c +++ b/demos/gtk-demo/gtkfishbowl.c @@ -411,8 +411,7 @@ gtk_fishbowl_set_count (GtkFishbowl *fishbowl, GtkWidget *new_widget; if (priv->use_icons) - new_widget = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ()), - GTK_ICON_SIZE_DIALOG); + new_widget = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ())); else new_widget = g_object_new (get_random_widget_type (), NULL); diff --git a/demos/gtk-demo/headerbar.c b/demos/gtk-demo/headerbar.c index 150ee4ad40..5e6e64cb59 100644 --- a/demos/gtk-demo/headerbar.c +++ b/demos/gtk-demo/headerbar.c @@ -36,7 +36,7 @@ do_headerbar (GtkWidget *do_widget) button = gtk_button_new (); icon = g_themed_icon_new ("mail-send-receive-symbolic"); - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_gicon (icon); g_object_unref (icon); gtk_container_add (GTK_CONTAINER (button), image); gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button); @@ -44,10 +44,10 @@ do_headerbar (GtkWidget *do_widget) box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_style_context_add_class (gtk_widget_get_style_context (box), "linked"); button = gtk_button_new (); - gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-start-symbolic", GTK_ICON_SIZE_BUTTON)); + gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-start-symbolic")); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new (); - gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-end-symbolic", GTK_ICON_SIZE_BUTTON)); + gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-end-symbolic")); gtk_container_add (GTK_CONTAINER (box), button); gtk_header_bar_pack_start (GTK_HEADER_BAR (header), box); diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c index 7f7fdc0081..2dfc7c267f 100644 --- a/demos/gtk-demo/images.c +++ b/demos/gtk-demo/images.c @@ -353,7 +353,7 @@ do_images (GtkWidget *do_widget) gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (vbox), frame); - image = gtk_image_new_from_icon_name ("gtk3-demo", GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name ("gtk3-demo"); gtk_container_add (GTK_CONTAINER (frame), image); @@ -389,7 +389,7 @@ do_images (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame); gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic"); - image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_gicon (gicon); gtk_container_add (GTK_CONTAINER (frame), image); diff --git a/demos/gtk-demo/listbox.c b/demos/gtk-demo/listbox.c index b20c23aabd..7c96d0ccf9 100644 --- a/demos/gtk-demo/listbox.c +++ b/demos/gtk-demo/listbox.c @@ -197,7 +197,7 @@ gtk_message_row_update (GtkMessageRow *row) gtk_button_set_label (GTK_BUTTON (priv->resent_by_button), priv->message->resent_by); if (strcmp (priv->message->sender_nick, "@GTKtoolkit") == 0) - gtk_image_set_from_icon_name (priv->avatar_image, "gtk3-demo", GTK_ICON_SIZE_DND); + gtk_image_set_from_icon_name (priv->avatar_image, "gtk3-demo"); else gtk_image_set_from_pixbuf (priv->avatar_image, avatar_pixbuf_other); diff --git a/demos/gtk-demo/sidebar.c b/demos/gtk-demo/sidebar.c index 27e84946e0..f0446021f4 100644 --- a/demos/gtk-demo/sidebar.c +++ b/demos/gtk-demo/sidebar.c @@ -65,7 +65,7 @@ do_sidebar (GtkWidget *do_widget) { if (i == 0) { - widget = gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_MENU); + widget = gtk_image_new_from_icon_name ("help-about"); gtk_image_set_pixel_size (GTK_IMAGE (widget), 256); } else diff --git a/demos/icon-browser/iconbrowserwin.c b/demos/icon-browser/iconbrowserwin.c index 2ec003f936..89f4e72044 100644 --- a/demos/icon-browser/iconbrowserwin.c +++ b/demos/icon-browser/iconbrowserwin.c @@ -96,7 +96,7 @@ set_image (GtkWidget *image, const gchar *name, gint size) { GdkPixbuf *pixbuf; - gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1); + gtk_image_set_from_icon_name (GTK_IMAGE (image), name); gtk_image_set_pixel_size (GTK_IMAGE (image), size); pixbuf = get_icon (image, name, size); gtk_drag_source_set_icon_pixbuf (image, pixbuf); @@ -413,7 +413,7 @@ get_scalable_image_data (GtkWidget *widget, const gchar *name; image = gtk_bin_get_child (GTK_BIN (widget)); - gtk_image_get_icon_name (GTK_IMAGE (image), &name, NULL); + name = gtk_image_get_icon_name (GTK_IMAGE (image)); info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, -1, 0); file = g_file_new_for_path (gtk_icon_info_get_filename (info)); diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index bfab623f2a..b7a7037904 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -1923,8 +1923,7 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about, } g_free (sizes); - gtk_image_set_from_icon_name (GTK_IMAGE (priv->logo_image), icon_name, - GTK_ICON_SIZE_DIALOG); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->logo_image), icon_name); gtk_image_set_pixel_size (GTK_IMAGE (priv->logo_image), best_size); } else if ((icons = gtk_window_get_default_icon_list ())) diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c index 4053088e99..87c548e75c 100644 --- a/gtk/gtkappchooserdialog.c +++ b/gtk/gtkappchooserdialog.c @@ -487,7 +487,7 @@ setup_search (GtkAppChooserDialog *self) button = gtk_toggle_button_new (); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - image = gtk_image_new_from_icon_name ("edit-find-symbolic", GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("edit-find-symbolic"); gtk_widget_show (image); gtk_container_add (GTK_CONTAINER (button), image); gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button"); diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 06d21bf8f0..104e0216b9 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -1106,14 +1106,14 @@ gtk_button_set_icon_name (GtkButton *button, if (child != NULL) gtk_container_remove (GTK_CONTAINER (button), child); - child = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON); + child = gtk_image_new_from_icon_name (icon_name); gtk_container_add (GTK_CONTAINER (button), child); gtk_style_context_remove_class (context, "text-button"); gtk_style_context_add_class (context, "image-button"); } else { - gtk_image_set_from_icon_name (GTK_IMAGE (child), icon_name, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (GTK_IMAGE (child), icon_name); } gtk_button_set_child_type (button, ICON_CHILD); diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index b47a137fba..eef11b5463 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -419,9 +419,9 @@ update_icon (GtkColorSwatch *swatch) GtkImage *image = GTK_IMAGE (swatch->priv->overlay_widget); if (swatch->priv->icon) - gtk_image_set_from_icon_name (image, swatch->priv->icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, swatch->priv->icon); else if (gtk_widget_get_state_flags (GTK_WIDGET (swatch)) & GTK_STATE_FLAG_SELECTED) - gtk_image_set_from_icon_name (image, "object-select-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, "object-select-symbolic"); else gtk_image_clear (image); } diff --git a/gtk/gtkcustompaperunixdialog.c b/gtk/gtkcustompaperunixdialog.c index 2c44aac28b..ffbdfb24ef 100644 --- a/gtk/gtkcustompaperunixdialog.c +++ b/gtk/gtkcustompaperunixdialog.c @@ -1003,7 +1003,7 @@ toolbutton_new (GtkCustomPaperUnixDialog *dialog, GtkWidget *image; item = gtk_tool_button_new (NULL, NULL); - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_SMALL_TOOLBAR); + image = gtk_image_new_from_gicon (icon); gtk_widget_show (image); gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (item), image); diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 400ac1f05d..109151af1c 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -7585,7 +7585,7 @@ gtk_entry_set_icon_from_icon_name (GtkEntry *entry, if (icon_name != NULL) { - gtk_image_set_from_icon_name (GTK_IMAGE (icon_info->widget), icon_name, GTK_ICON_SIZE_MENU); + gtk_image_set_from_icon_name (GTK_IMAGE (icon_info->widget), icon_name); if (icon_pos == GTK_ENTRY_ICON_PRIMARY) { @@ -7642,7 +7642,7 @@ gtk_entry_set_icon_from_gicon (GtkEntry *entry, if (icon) { - gtk_image_set_from_gicon (GTK_IMAGE (icon_info->widget), icon, GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (icon_info->widget), icon); if (icon_pos == GTK_ENTRY_ICON_PRIMARY) { @@ -7787,8 +7787,6 @@ gtk_entry_get_icon_gicon (GtkEntry *entry, { GtkEntryPrivate *priv; EntryIconInfo *icon_info; - GIcon *icon; - GtkIconSize icon_size; g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL); g_return_val_if_fail (IS_VALID_ICON_POSITION (icon_pos), NULL); @@ -7799,9 +7797,7 @@ gtk_entry_get_icon_gicon (GtkEntry *entry, if (!icon_info) return NULL; - gtk_image_get_gicon (GTK_IMAGE (icon_info->widget), &icon, &icon_size); - - return icon; + return gtk_image_get_gicon (GTK_IMAGE (icon_info->widget)); } /** @@ -7824,8 +7820,6 @@ gtk_entry_get_icon_name (GtkEntry *entry, { GtkEntryPrivate *priv; EntryIconInfo *icon_info; - const char *icon_name; - GtkIconSize icon_size; g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL); g_return_val_if_fail (IS_VALID_ICON_POSITION (icon_pos), NULL); @@ -7836,9 +7830,7 @@ gtk_entry_get_icon_name (GtkEntry *entry, if (!icon_info) return NULL; - gtk_image_get_icon_name (GTK_IMAGE (icon_info->widget), &icon_name, &icon_size); - - return icon_name; + return gtk_image_get_icon_name (GTK_IMAGE (icon_info->widget)); } /** @@ -8627,7 +8619,7 @@ append_bubble_action (GtkEntry *entry, item = gtk_button_new (); gtk_widget_set_focus_on_click (item, FALSE); - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name (icon_name); gtk_widget_show (image); gtk_container_add (GTK_CONTAINER (item), image); gtk_widget_set_tooltip_text (item, label); diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index ae88e42e17..dfcec5fe5e 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -505,7 +505,7 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button) priv->label = gtk_label_new (_(FALLBACK_DISPLAY_NAME)); gtk_label_set_xalign (GTK_LABEL (priv->label), 0.0f); gtk_widget_set_hexpand (priv->label, TRUE); - icon = gtk_image_new_from_icon_name ("document-open-symbolic", GTK_ICON_SIZE_BUTTON); + icon = gtk_image_new_from_icon_name ("document-open-symbolic"); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_valign (priv->image, GTK_ALIGN_BASELINE); gtk_container_add (GTK_CONTAINER (box), priv->image); @@ -2481,7 +2481,7 @@ update_label_get_info_cb (GCancellable *cancellable, gtk_label_set_text (GTK_LABEL (priv->label), g_file_info_get_display_name (info)); icon = _gtk_file_info_get_icon (info, priv->icon_size, gtk_widget_get_scale_factor (GTK_WIDGET (button))); - gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon); gtk_image_set_pixel_size (GTK_IMAGE (priv->image), priv->icon_size); if (icon) g_object_unref (icon); @@ -2528,7 +2528,7 @@ update_label_and_image (GtkFileChooserButton *button) label_text = _gtk_file_system_volume_get_display_name (volume); icon = _gtk_file_system_volume_get_icon (volume); - gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon); gtk_image_set_pixel_size (GTK_IMAGE (priv->image), priv->icon_size); if (icon) g_object_unref (icon); @@ -2560,7 +2560,7 @@ update_label_and_image (GtkFileChooserButton *button) label_text = _gtk_bookmarks_manager_get_bookmark_label (button->priv->bookmarks_manager, file); icon = g_themed_icon_new ("text-x-generic"); - gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon); gtk_image_set_pixel_size (GTK_IMAGE (priv->image), priv->icon_size); if (icon) g_object_unref (icon); @@ -2587,7 +2587,7 @@ out: else { gtk_label_set_text (GTK_LABEL (priv->label), _(FALLBACK_DISPLAY_NAME)); - gtk_image_set_from_gicon (GTK_IMAGE (priv->image), NULL, priv->icon_size); + gtk_image_set_from_gicon (GTK_IMAGE (priv->image), NULL); } if (done_changing_selection) diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index f1240eb154..0a24db4a40 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -375,8 +375,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) priv->titlebar_icon = image; if (!_gtk_header_bar_update_window_icon (bar, window)) - gtk_image_set_from_icon_name (GTK_IMAGE (priv->titlebar_icon), - "application-x-executable-symbolic", GTK_ICON_SIZE_MENU); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->titlebar_icon), "application-x-executable-symbolic"); priv->shows_app_menu = TRUE; } @@ -387,7 +386,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton"); gtk_style_context_add_class (gtk_widget_get_style_context (button), "minimize"); - image = gtk_image_new_from_icon_name ("window-minimize-symbolic", GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("window-minimize-symbolic"); g_object_set (image, "use-fallback", TRUE, NULL); gtk_container_add (GTK_CONTAINER (button), image); gtk_widget_set_can_focus (button, FALSE); @@ -410,7 +409,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton"); gtk_style_context_add_class (gtk_widget_get_style_context (button), "maximize"); - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name (icon_name); g_object_set (image, "use-fallback", TRUE, NULL); gtk_container_add (GTK_CONTAINER (button), image); gtk_widget_set_can_focus (button, FALSE); @@ -426,7 +425,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) { button = gtk_button_new (); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); - image = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("window-close-symbolic"); gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton"); gtk_style_context_add_class (gtk_widget_get_style_context (button), "close"); g_object_set (image, "use-fallback", TRUE, NULL); diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index 094802ee8c..31b28354f5 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -95,7 +95,6 @@ _gtk_icon_helper_clear (GtkIconHelper *self) self->def = gtk_image_definition_new_empty (); gtk_icon_helper_invalidate (self); } - self->icon_size = GTK_ICON_SIZE_INVALID; } void @@ -114,7 +113,6 @@ gtk_icon_helper_init (GtkIconHelper *self, memset (self, 0, sizeof (GtkIconHelper)); self->def = gtk_image_definition_new_empty (); - self->icon_size = GTK_ICON_SIZE_INVALID; self->pixel_size = -1; self->texture_is_symbolic = FALSE; @@ -479,22 +477,18 @@ _gtk_icon_helper_set_definition (GtkIconHelper *self, _gtk_icon_helper_clear (self); } -void +void _gtk_icon_helper_set_gicon (GtkIconHelper *self, - GIcon *gicon, - GtkIconSize icon_size) + GIcon *gicon) { gtk_icon_helper_take_definition (self, gtk_image_definition_new_gicon (gicon)); - _gtk_icon_helper_set_icon_size (self, icon_size); } -void +void _gtk_icon_helper_set_icon_name (GtkIconHelper *self, - const gchar *icon_name, - GtkIconSize icon_size) + const gchar *icon_name) { gtk_icon_helper_take_definition (self, gtk_image_definition_new_icon_name (icon_name)); - _gtk_icon_helper_set_icon_size (self, icon_size); } void diff --git a/gtk/gtkiconhelperprivate.h b/gtk/gtkiconhelperprivate.h index 158b4c4edd..42ba490bb6 100644 --- a/gtk/gtkiconhelperprivate.h +++ b/gtk/gtkiconhelperprivate.h @@ -62,12 +62,10 @@ gboolean _gtk_icon_helper_get_is_empty (GtkIconHelper *self); void _gtk_icon_helper_set_definition (GtkIconHelper *self, GtkImageDefinition *def); void _gtk_icon_helper_set_gicon (GtkIconHelper *self, - GIcon *gicon, - GtkIconSize icon_size); + GIcon *gicon); void _gtk_icon_helper_set_icon_name (GtkIconHelper *self, - const gchar *icon_name, - GtkIconSize icon_size); + const gchar *icon_name); void _gtk_icon_helper_set_surface (GtkIconHelper *self, cairo_surface_t *surface); void _gtk_icon_helper_set_texture (GtkIconHelper *self, diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index e010986a55..734d783d23 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -307,10 +307,6 @@ gtk_image_set_property (GObject *object, { GtkImage *image = GTK_IMAGE (object); GtkImagePrivate *priv = gtk_image_get_instance_private (image); - GtkIconSize icon_size = _gtk_icon_helper_get_icon_size (&priv->icon_helper); - - if (icon_size == GTK_ICON_SIZE_INVALID) - icon_size = DEFAULT_ICON_SIZE; switch (prop_id) { @@ -324,20 +320,16 @@ gtk_image_set_property (GObject *object, gtk_image_set_from_file (image, g_value_get_string (value)); break; case PROP_ICON_SIZE: - if (_gtk_icon_helper_set_icon_size (&priv->icon_helper, g_value_get_int (value))) - { - g_object_notify_by_pspec (object, pspec); - gtk_widget_queue_resize (GTK_WIDGET (image)); - } + gtk_image_set_icon_size (image, g_value_get_int (value)); break; case PROP_PIXEL_SIZE: gtk_image_set_pixel_size (image, g_value_get_int (value)); break; case PROP_ICON_NAME: - gtk_image_set_from_icon_name (image, g_value_get_string (value), icon_size); + gtk_image_set_from_icon_name (image, g_value_get_string (value)); break; case PROP_GICON: - gtk_image_set_from_gicon (image, g_value_get_object (value), icon_size); + gtk_image_set_from_gicon (image, g_value_get_object (value)); break; case PROP_RESOURCE: gtk_image_set_from_resource (image, g_value_get_string (value)); @@ -524,7 +516,6 @@ gtk_image_new_from_surface (cairo_surface_t *surface) /** * gtk_image_new_from_icon_name: * @icon_name: (nullable): an icon name or %NULL - * @size: (type int): a stock icon size (#GtkIconSize) * * Creates a #GtkImage displaying an icon from the current icon theme. * If the icon name isn’t known, a “broken image” icon will be @@ -536,14 +527,13 @@ gtk_image_new_from_surface (cairo_surface_t *surface) * Since: 2.6 **/ GtkWidget* -gtk_image_new_from_icon_name (const gchar *icon_name, - GtkIconSize size) +gtk_image_new_from_icon_name (const gchar *icon_name) { GtkImage *image; image = g_object_new (GTK_TYPE_IMAGE, NULL); - gtk_image_set_from_icon_name (image, icon_name, size); + gtk_image_set_from_icon_name (image, icon_name); return GTK_WIDGET (image); } @@ -551,7 +541,6 @@ gtk_image_new_from_icon_name (const gchar *icon_name, /** * gtk_image_new_from_gicon: * @icon: an icon - * @size: (type int): a stock icon size (#GtkIconSize) * * Creates a #GtkImage displaying an icon from the current icon theme. * If the icon name isn’t known, a “broken image” icon will be @@ -563,14 +552,13 @@ gtk_image_new_from_icon_name (const gchar *icon_name, * Since: 2.14 **/ GtkWidget* -gtk_image_new_from_gicon (GIcon *icon, - GtkIconSize size) +gtk_image_new_from_gicon (GIcon *icon) { GtkImage *image; image = g_object_new (GTK_TYPE_IMAGE, NULL); - gtk_image_set_from_gicon (image, icon, size); + gtk_image_set_from_gicon (image, icon); return GTK_WIDGET (image); } @@ -698,9 +686,7 @@ gtk_image_set_from_file (GtkImage *image, if (anim == NULL) { - gtk_image_set_from_icon_name (image, - "image-missing", - DEFAULT_ICON_SIZE); + gtk_image_set_from_icon_name (image, "image-missing"); g_object_thaw_notify (G_OBJECT (image)); return; } @@ -787,9 +773,7 @@ gtk_image_set_from_resource (GtkImage *image, if (animation == NULL) { - gtk_image_set_from_icon_name (image, - "image-missing", - DEFAULT_ICON_SIZE); + gtk_image_set_from_icon_name (image, "image-missing"); g_object_thaw_notify (G_OBJECT (image)); return; } @@ -844,16 +828,14 @@ gtk_image_set_from_pixbuf (GtkImage *image, * gtk_image_set_from_icon_name: * @image: a #GtkImage * @icon_name: (nullable): an icon name or %NULL - * @size: (type int): an icon size (#GtkIconSize) * * See gtk_image_new_from_icon_name() for details. - * + * * Since: 2.6 **/ void -gtk_image_set_from_icon_name (GtkImage *image, - const gchar *icon_name, - GtkIconSize size) +gtk_image_set_from_icon_name (GtkImage *image, + const gchar *icon_name) { GtkImagePrivate *priv = gtk_image_get_instance_private (image); @@ -864,10 +846,9 @@ gtk_image_set_from_icon_name (GtkImage *image, gtk_image_clear (image); if (icon_name) - _gtk_icon_helper_set_icon_name (&priv->icon_helper, icon_name, size); + _gtk_icon_helper_set_icon_name (&priv->icon_helper, icon_name); g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_NAME]); - g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SIZE]); g_object_thaw_notify (G_OBJECT (image)); } @@ -876,16 +857,14 @@ gtk_image_set_from_icon_name (GtkImage *image, * gtk_image_set_from_gicon: * @image: a #GtkImage * @icon: an icon - * @size: (type int): an icon size (#GtkIconSize) * * See gtk_image_new_from_gicon() for details. - * + * * Since: 2.14 **/ void gtk_image_set_from_gicon (GtkImage *image, - GIcon *icon, - GtkIconSize size) + GIcon *icon) { GtkImagePrivate *priv = gtk_image_get_instance_private (image); @@ -900,12 +879,11 @@ gtk_image_set_from_gicon (GtkImage *image, if (icon) { - _gtk_icon_helper_set_gicon (&priv->icon_helper, icon, size); + _gtk_icon_helper_set_gicon (&priv->icon_helper, icon); g_object_unref (icon); } g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_GICON]); - g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SIZE]); g_object_thaw_notify (G_OBJECT (image)); } @@ -1382,6 +1360,30 @@ gtk_image_get_pixel_size (GtkImage *image) } /** + * gtk_image_set_icon_size: + * @image: a #GtkImage + * @icon_size: the new icon size + * + * Suggests an icon size to the theme for named icons. + * + * Since: 3.94 + */ +void +gtk_image_set_icon_size (GtkImage *image, + GtkIconSize icon_size) +{ + GtkImagePrivate *priv = gtk_image_get_instance_private (image); + + g_return_if_fail (GTK_IS_IMAGE (image)); + + if (_gtk_icon_helper_set_icon_size (&priv->icon_helper, icon_size)) + { + gtk_widget_queue_resize (GTK_WIDGET (image)); + g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SIZE]); + } +} + +/** * gtk_image_get_icon_size: * @image: a #GtkImage * @@ -1394,7 +1396,9 @@ gtk_image_get_pixel_size (GtkImage *image) GtkIconSize gtk_image_get_icon_size (GtkImage *image) { + GtkImagePrivate *priv = gtk_image_get_instance_private (image); + g_return_val_if_fail (GTK_IS_IMAGE (image), GTK_ICON_SIZE_INVALID); - return _gtk_icon_helper_get_icon_size (image->priv->icon_helper); + return _gtk_icon_helper_get_icon_size (&priv->icon_helper); } diff --git a/gtk/gtkimage.h b/gtk/gtkimage.h index 9e041c10ee..7f561c8b16 100644 --- a/gtk/gtkimage.h +++ b/gtk/gtkimage.h @@ -113,11 +113,9 @@ GtkWidget* gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf); GDK_AVAILABLE_IN_3_94 GtkWidget* gtk_image_new_from_texture (GdkTexture *texture); GDK_AVAILABLE_IN_ALL -GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name, - GtkIconSize size); +GtkWidget* gtk_image_new_from_icon_name (const gchar *icon_name); GDK_AVAILABLE_IN_ALL -GtkWidget* gtk_image_new_from_gicon (GIcon *icon, - GtkIconSize size); +GtkWidget* gtk_image_new_from_gicon (GIcon *icon); GDK_AVAILABLE_IN_3_10 GtkWidget* gtk_image_new_from_surface (cairo_surface_t *surface); @@ -137,18 +135,19 @@ void gtk_image_set_from_texture (GtkImage *image, GdkTexture *texture); GDK_AVAILABLE_IN_ALL void gtk_image_set_from_icon_name (GtkImage *image, - const gchar *icon_name, - GtkIconSize size); + const gchar *icon_name); GDK_AVAILABLE_IN_ALL void gtk_image_set_from_gicon (GtkImage *image, - GIcon *icon, - GtkIconSize size); + GIcon *icon); GDK_AVAILABLE_IN_3_10 void gtk_image_set_from_surface (GtkImage *image, cairo_surface_t *surface); GDK_AVAILABLE_IN_ALL void gtk_image_set_pixel_size (GtkImage *image, gint pixel_size); +GDK_AVAILABLE_IN_3_94 +void gtk_image_set_icon_size (GtkImage *image, + GtkIconSize icon_size); GDK_AVAILABLE_IN_ALL GtkImageType gtk_image_get_storage_type (GtkImage *image); diff --git a/gtk/gtklockbutton.c b/gtk/gtklockbutton.c index 424fbee047..39e897479a 100644 --- a/gtk/gtklockbutton.c +++ b/gtk/gtklockbutton.c @@ -384,7 +384,7 @@ update_state (GtkLockButton *button) g_assert_not_reached (); } - gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon, GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (priv->image), icon); gtk_stack_set_visible_child (GTK_STACK (priv->stack), allowed ? priv->label_lock : priv->label_unlock); _gtk_lock_button_accessible_name_changed (button); diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index 6c9a13c0f0..74916069b0 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -586,19 +586,19 @@ set_arrow_type (GtkImage *image, switch (arrow_type) { case GTK_ARROW_NONE: - gtk_image_set_from_icon_name (image, "open-menu-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, "open-menu-symbolic"); break; case GTK_ARROW_DOWN: - gtk_image_set_from_icon_name (image, "pan-down-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, "pan-down-symbolic"); break; case GTK_ARROW_UP: - gtk_image_set_from_icon_name (image, "pan-up-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, "pan-up-symbolic"); break; case GTK_ARROW_LEFT: - gtk_image_set_from_icon_name (image, "pan-start-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, "pan-start-symbolic"); break; case GTK_ARROW_RIGHT: - gtk_image_set_from_icon_name (image, "pan-end-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (image, "pan-end-symbolic"); break; default: break; diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c index edb4790f97..59f957ceff 100644 --- a/gtk/gtkmodelbutton.c +++ b/gtk/gtkmodelbutton.c @@ -375,7 +375,7 @@ static void gtk_model_button_set_icon (GtkModelButton *button, GIcon *icon) { - gtk_image_set_from_gicon (GTK_IMAGE (button->image), icon, GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (button->image), icon); update_visibility (button); g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_ICON]); } diff --git a/gtk/gtkmodelmenuitem.c b/gtk/gtkmodelmenuitem.c index b33d798a10..88a0ad08fd 100644 --- a/gtk/gtkmodelmenuitem.c +++ b/gtk/gtkmodelmenuitem.c @@ -188,7 +188,7 @@ gtk_model_menu_item_set_icon (GtkModelMenuItem *item, { GtkWidget *image; - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_gicon (icon); gtk_image_set_pixel_size (GTK_IMAGE (image), 16); gtk_container_add (GTK_CONTAINER (child), image); gtk_box_reorder_child (GTK_BOX (child), image, 0); diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c index ddb93b6214..58a3a0eda6 100644 --- a/gtk/gtkmountoperation.c +++ b/gtk/gtkmountoperation.c @@ -549,8 +549,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation, hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (content_area), hbox); - icon = gtk_image_new_from_icon_name ("dialog-password", - GTK_ICON_SIZE_DIALOG); + icon = gtk_image_new_from_icon_name ("dialog-password"); gtk_widget_set_halign (icon, GTK_ALIGN_CENTER); gtk_widget_set_valign (icon, GTK_ALIGN_START); diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index b4618346a6..2e181d3ad8 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -1292,7 +1292,7 @@ set_button_image_get_info_cb (GCancellable *cancellable, goto out; icon = g_file_info_get_symbolic_icon (info); - gtk_image_set_from_gicon (GTK_IMAGE (data->button_data->image), icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (data->button_data->image), icon); switch (data->button_data->type) { @@ -1327,7 +1327,7 @@ set_button_image (GtkPathBar *path_bar, if (path_bar->priv->root_icon != NULL) { - gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->root_icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->root_icon); break; } @@ -1337,14 +1337,14 @@ set_button_image (GtkPathBar *path_bar, path_bar->priv->root_icon = _gtk_file_system_volume_get_symbolic_icon (volume); _gtk_file_system_volume_unref (volume); - gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->root_icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->root_icon); break; case HOME_BUTTON: if (path_bar->priv->home_icon != NULL) { - gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->home_icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->home_icon); break; } @@ -1369,7 +1369,7 @@ set_button_image (GtkPathBar *path_bar, case DESKTOP_BUTTON: if (path_bar->priv->desktop_icon != NULL) { - gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->desktop_icon, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), path_bar->priv->desktop_icon); break; } diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index 405c1a1518..2f3fa86e3e 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -582,7 +582,7 @@ populate_servers (GtkPlacesView *view) gtk_container_add (GTK_CONTAINER (grid), label); /* remove button */ - button = gtk_button_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_BUTTON); + button = gtk_button_new_from_icon_name ("window-close-symbolic"); gtk_widget_set_halign (button, GTK_ALIGN_END); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); diff --git a/gtk/gtkplacesviewrow.c b/gtk/gtkplacesviewrow.c index 87fbf1414a..fbac40027a 100644 --- a/gtk/gtkplacesviewrow.c +++ b/gtk/gtkplacesviewrow.c @@ -263,9 +263,7 @@ gtk_places_view_row_set_property (GObject *object, switch (prop_id) { case PROP_ICON: - gtk_image_set_from_gicon (self->icon_image, - g_value_get_object (value), - GTK_ICON_SIZE_LARGE_TOOLBAR); + gtk_image_set_from_gicon (self->icon_image, g_value_get_object (value)); break; case PROP_NAME: @@ -463,7 +461,7 @@ gtk_places_view_row_set_is_network (GtkPlacesViewRow *row, { row->is_network = is_network; - gtk_image_set_from_icon_name (row->eject_icon, "media-eject-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (row->eject_icon, "media-eject-symbolic"); gtk_widget_set_tooltip_text (GTK_WIDGET (row->eject_button), is_network ? _("Disconnect") : _("Unmount")); } } diff --git a/gtk/gtkprintbackend.c b/gtk/gtkprintbackend.c index 409427982f..e8f821ab8f 100644 --- a/gtk/gtkprintbackend.c +++ b/gtk/gtkprintbackend.c @@ -769,7 +769,7 @@ request_password (GtkPrintBackend *backend, main_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); /* Left */ - icon = gtk_image_new_from_icon_name ("dialog-password-symbolic", GTK_ICON_SIZE_DIALOG); + icon = gtk_image_new_from_icon_name ("dialog-password-symbolic"); gtk_widget_set_halign (icon, GTK_ALIGN_CENTER); gtk_widget_set_valign (icon, GTK_ALIGN_START); g_object_set (icon, "margin", 12, NULL); diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c index 1707e151b3..89c563a30f 100644 --- a/gtk/gtkprinteroptionwidget.c +++ b/gtk/gtkprinteroptionwidget.c @@ -896,7 +896,7 @@ construct_widgets (GtkPrinterOptionWidget *widget) break; } - priv->image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_MENU); + priv->image = gtk_image_new_from_icon_name ("dialog-warning"); gtk_box_pack_start (GTK_BOX (widget), priv->image); } diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c index 8f84c2836a..a99e5cc18f 100644 --- a/gtk/gtkrecentchoosermenu.c +++ b/gtk/gtkrecentchoosermenu.c @@ -818,7 +818,7 @@ gtk_recent_chooser_menu_create_item (GtkRecentChooserMenu *menu, { icon = gtk_recent_info_get_gicon (info); - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_gicon (icon); if (icon) g_object_unref (icon); diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 971547f466..c6ab5942f1 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -952,9 +952,7 @@ gtk_scale_button_update_icon (GtkScaleButton *button) if (!priv->icon_list || priv->icon_list[0][0] == '\0') { - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - "image-missing", - GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), "image-missing"); return; } @@ -963,9 +961,7 @@ gtk_scale_button_update_icon (GtkScaleButton *button) /* The 1-icon special case */ if (num_icons == 1) { - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - priv->icon_list[0], - GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), priv->icon_list[0]); return; } @@ -983,9 +979,7 @@ gtk_scale_button_update_icon (GtkScaleButton *button) else name = priv->icon_list[1]; - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - name, - GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), name); return; } @@ -1008,9 +1002,7 @@ gtk_scale_button_update_icon (GtkScaleButton *button) name = priv->icon_list[i]; } - gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), - name, - GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), name); } static void diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c index 2dcb96b5aa..7ad524117f 100644 --- a/gtk/gtkshortcutsshortcut.c +++ b/gtk/gtkshortcutsshortcut.c @@ -249,7 +249,7 @@ update_icon_from_type (GtkShortcutsShortcut *self) if (icon) { - gtk_image_set_from_gicon (self->image, icon, GTK_ICON_SIZE_DIALOG); + gtk_image_set_from_gicon (self->image, icon); gtk_image_set_pixel_size (self->image, 64); g_object_unref (icon); } @@ -271,7 +271,7 @@ static void gtk_shortcuts_shortcut_set_icon (GtkShortcutsShortcut *self, GIcon *gicon) { - gtk_image_set_from_gicon (self->image, gicon, GTK_ICON_SIZE_DIALOG); + gtk_image_set_from_gicon (self->image, gicon); gtk_shortcuts_shortcut_set_icon_set (self, gicon != NULL); g_object_notify (G_OBJECT (self), "icon"); } diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c index d5600eda9b..7f77a53d78 100644 --- a/gtk/gtkshortcutswindow.c +++ b/gtk/gtkshortcutswindow.c @@ -934,8 +934,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self) NULL); gtk_container_add (GTK_CONTAINER (menu_box), GTK_WIDGET (priv->menu_label)); - arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", - GTK_ICON_SIZE_BUTTON); + arrow = gtk_image_new_from_icon_name ("pan-down-symbolic"); gtk_container_add (GTK_CONTAINER (menu_box), GTK_WIDGET (arrow)); priv->popover = g_object_new (GTK_TYPE_POPOVER, diff --git a/gtk/gtksidebarrow.c b/gtk/gtksidebarrow.c index 26bce9b3b6..0634e5012a 100644 --- a/gtk/gtksidebarrow.c +++ b/gtk/gtksidebarrow.c @@ -225,9 +225,7 @@ gtk_sidebar_row_set_property (GObject *object, if (object != NULL) { self->start_icon = g_object_ref (object); - gtk_image_set_from_gicon (GTK_IMAGE (self->start_icon_widget), - self->start_icon, - GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (self->start_icon_widget), self->start_icon); } else { @@ -243,9 +241,7 @@ gtk_sidebar_row_set_property (GObject *object, if (object != NULL) { self->end_icon = g_object_ref (object); - gtk_image_set_from_gicon (GTK_IMAGE (self->end_icon_widget), - self->end_icon, - GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (self->end_icon_widget), self->end_icon); gtk_widget_show (self->end_icon_widget); } else @@ -411,8 +407,7 @@ gtk_sidebar_row_set_start_icon (GtkSidebarRow *self, { g_set_object (&self->start_icon, icon); if (self->start_icon != NULL) - gtk_image_set_from_gicon (GTK_IMAGE (self->start_icon_widget), self->start_icon, - GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (self->start_icon_widget), self->start_icon); else gtk_image_clear (GTK_IMAGE (self->start_icon_widget)); @@ -430,8 +425,7 @@ gtk_sidebar_row_set_end_icon (GtkSidebarRow *self, { g_set_object (&self->end_icon, icon); if (self->end_icon != NULL) - gtk_image_set_from_gicon (GTK_IMAGE (self->end_icon_widget), self->end_icon, - GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (self->end_icon_widget), self->end_icon); else if (self->end_icon_widget != NULL) gtk_image_clear (GTK_IMAGE (self->end_icon_widget)); diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c index 06fd45700f..c34950b388 100644 --- a/gtk/gtkstackswitcher.c +++ b/gtk/gtkstackswitcher.c @@ -137,7 +137,7 @@ rebuild_child (GtkWidget *self, if (icon_name != NULL) { - button_child = gtk_image_new_from_icon_name (icon_name, icon_size); + button_child = gtk_image_new_from_icon_name (icon_name); if (title != NULL) gtk_widget_set_tooltip_text (GTK_WIDGET (self), title); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 613e95bde8..8536b82da1 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -9082,7 +9082,7 @@ append_bubble_action (GtkTextView *text_view, item = gtk_button_new (); gtk_widget_set_focus_on_click (item, FALSE); - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name (icon_name); gtk_widget_show (image); gtk_container_add (GTK_CONTAINER (item), image); gtk_widget_set_tooltip_text (item, label); diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index d262d00716..b01243f938 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -580,7 +580,7 @@ gtk_toolbar_init (GtkToolbar *toolbar) gtk_widget_set_focus_on_click (priv->arrow_button, FALSE); - priv->arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON); + priv->arrow = gtk_image_new_from_icon_name ("pan-down-symbolic"); gtk_widget_set_name (priv->arrow, "gtk-toolbar-arrow"); gtk_container_add (GTK_CONTAINER (priv->arrow_button), priv->arrow); @@ -2197,9 +2197,9 @@ gtk_toolbar_orientation_changed (GtkToolbar *toolbar, priv->orientation = orientation; if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_image_set_from_icon_name (GTK_IMAGE (priv->arrow), "pan-down-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->arrow), "pan-down-symbolic"); else - gtk_image_set_from_icon_name (GTK_IMAGE (priv->arrow), "pan-end-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->arrow), "pan-end-symbolic"); gtk_toolbar_reconfigured (toolbar); diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 90d7066a90..a1006747bc 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -460,7 +460,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item) } else if (button->priv->icon_name) { - icon = gtk_image_new_from_icon_name (button->priv->icon_name, GTK_ICON_SIZE_SMALL_TOOLBAR); + icon = gtk_image_new_from_icon_name (button->priv->icon_name); } if (icon) @@ -713,13 +713,13 @@ clone_image_menu_size (GtkImage *image) { const gchar *icon_name = gtk_image_get_icon_name (image); - return gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + return gtk_image_new_from_icon_name (icon_name); } else if (storage_type == GTK_IMAGE_GICON) { GIcon *icon = gtk_image_get_gicon (image); - return gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU); + return gtk_image_new_from_gicon (icon); } else if (storage_type == GTK_IMAGE_SURFACE) { diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c index 6a8aa5221f..a83078217e 100644 --- a/gtk/gtktooltipwindow.c +++ b/gtk/gtktooltipwindow.c @@ -141,7 +141,7 @@ gtk_tooltip_window_set_image_icon_from_name (GtkTooltipWindow *window, { if (icon_name) { - gtk_image_set_from_icon_name (GTK_IMAGE (window->image), icon_name, GTK_ICON_SIZE_MENU); + gtk_image_set_from_icon_name (GTK_IMAGE (window->image), icon_name); gtk_widget_show (window->image); } else @@ -156,7 +156,7 @@ gtk_tooltip_window_set_image_icon_from_gicon (GtkTooltipWindow *window, { if (gicon != NULL) { - gtk_image_set_from_gicon (GTK_IMAGE (window->image), gicon, GTK_ICON_SIZE_MENU); + gtk_image_set_from_gicon (GTK_IMAGE (window->image), gicon); gtk_widget_show (window->image); } else diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 872e8df29b..3186c7f43b 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -833,7 +833,7 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column) gtk_widget_set_halign (priv->frame, GTK_ALIGN_START); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - priv->arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON); + priv->arrow = gtk_image_new_from_icon_name ("pan-down-symbolic"); if (priv->child) child = priv->child; @@ -946,7 +946,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column) } } - gtk_image_set_from_icon_name (GTK_IMAGE (arrow), icon_name, GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name (GTK_IMAGE (arrow), icon_name); /* Put arrow on the right if the text is left-or-center justified, and on the * left otherwise; do this by packing boxes, so flipping text direction will diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index cf97a6fcae..6ccde9bc9a 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -170,7 +170,7 @@ add_check_row (GtkInspectorGeneral *gen, gtk_widget_set_hexpand (label, TRUE); gtk_box_pack_start (GTK_BOX (box), label); - check = gtk_image_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_MENU); + check = gtk_image_new_from_icon_name ("object-select-symbolic"); gtk_widget_set_halign (check, GTK_ALIGN_END); gtk_widget_set_valign (check, GTK_ALIGN_BASELINE); gtk_widget_set_opacity (check, value ? 1.0 : 0.0); diff --git a/tests/testadjustsize.c b/tests/testadjustsize.c index 1048697e2a..b97b35c474 100644 --- a/tests/testadjustsize.c +++ b/tests/testadjustsize.c @@ -35,8 +35,7 @@ static GtkWidget *test_widgets[TEST_WIDGET_LAST]; static GtkWidget* create_image (void) { - return gtk_image_new_from_icon_name ("document-open", - GTK_ICON_SIZE_BUTTON); + return gtk_image_new_from_icon_name ("document-open"); } static GtkWidget* diff --git a/tests/testappchooserbutton.c b/tests/testappchooserbutton.c index 53a9ded275..45be8a72aa 100644 --- a/tests/testappchooserbutton.c +++ b/tests/testappchooserbutton.c @@ -37,8 +37,7 @@ combo_changed_cb (GtkComboBox *cb, if (app_info == NULL) return; - gtk_image_set_from_gicon (GTK_IMAGE (sel_image), g_app_info_get_icon (app_info), - GTK_ICON_SIZE_DIALOG); + gtk_image_set_from_gicon (GTK_IMAGE (sel_image), g_app_info_get_icon (app_info)); gtk_label_set_text (GTK_LABEL (sel_name), g_app_info_get_display_name (app_info)); g_object_unref (app_info); @@ -49,8 +48,7 @@ special_item_activated_cb (GtkAppChooserButton *b, const gchar *item_name, gpointer user_data) { - gtk_image_set_from_gicon (GTK_IMAGE (sel_image), g_themed_icon_new ("face-smile"), - GTK_ICON_SIZE_DIALOG); + gtk_image_set_from_gicon (GTK_IMAGE (sel_image), g_themed_icon_new ("face-smile")); gtk_label_set_text (GTK_LABEL (sel_name), "Special Item"); } diff --git a/tests/testbaseline.c b/tests/testbaseline.c index 61e197a0a3..cd7cdad122 100644 --- a/tests/testbaseline.c +++ b/tests/testbaseline.c @@ -181,8 +181,7 @@ main (int argc, button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (box), gtk_label_new ("│Xyj,Ö")); - gtk_container_add (GTK_CONTAINER (box), - gtk_image_new_from_icon_name ("face-sad", GTK_ICON_SIZE_BUTTON)); + gtk_container_add (GTK_CONTAINER (box), gtk_image_new_from_icon_name ("face-sad")); gtk_container_add (GTK_CONTAINER (button), box); set_font_size (button, i); @@ -193,7 +192,7 @@ main (int argc, gtk_container_add (GTK_CONTAINER (hbox), button); } - image = gtk_image_new_from_icon_name ("face-sad", GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("face-sad"); gtk_image_set_pixel_size (GTK_IMAGE (image), 34); if (j == 0) gtk_widget_set_valign (image, GTK_ALIGN_BASELINE); @@ -274,8 +273,7 @@ main (int argc, button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (box), gtk_label_new ("│Xyj,Ö")); - gtk_container_add (GTK_CONTAINER (box), - gtk_image_new_from_icon_name ("face-sad", GTK_ICON_SIZE_BUTTON)); + gtk_container_add (GTK_CONTAINER (box), gtk_image_new_from_icon_name ("face-sad")); gtk_container_add (GTK_CONTAINER (button), box); set_font_size (button, i); @@ -340,7 +338,7 @@ main (int argc, gtk_container_add (GTK_CONTAINER (hbox), label); gtk_widget_set_vexpand (label, TRUE); - image = gtk_image_new_from_icon_name ("face-sad", GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("face-sad"); gtk_image_set_pixel_size (GTK_IMAGE (image), 34); gtk_container_add (GTK_CONTAINER (hbox), image); @@ -364,7 +362,7 @@ main (int argc, button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (box), gtk_label_new ("│Xyj,Ö")); - image = gtk_image_new_from_icon_name ("face-sad", GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("face-sad"); gtk_image_set_pixel_size (GTK_IMAGE (image), 16); gtk_container_add (GTK_CONTAINER (box), image); gtk_container_add (GTK_CONTAINER (button), box); diff --git a/tests/testdialog.c b/tests/testdialog.c index 07eba4b7b9..7ec34dc9cd 100644 --- a/tests/testdialog.c +++ b/tests/testdialog.c @@ -34,7 +34,7 @@ show_message_dialog1a (GtkWindow *parent) GTK_BUTTONS_OK, "The system network services are not compatible with this version.")); - image = gtk_image_new_from_icon_name ("computer-fail", GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name ("computer-fail"); gtk_widget_show (image); gtk_dialog_run (GTK_DIALOG (dialog)); diff --git a/tests/testdnd2.c b/tests/testdnd2.c index c4a1c98710..87ee8d770d 100644 --- a/tests/testdnd2.c +++ b/tests/testdnd2.c @@ -5,8 +5,10 @@ get_image_surface (GtkImage *image, int *out_size) { GtkIconTheme *icon_theme; + const char *icon_name; int width; cairo_surface_t *surface; + GtkIconSize size; switch (gtk_image_get_storage_type (image)) { @@ -15,8 +17,8 @@ get_image_surface (GtkImage *image, *out_size = cairo_image_surface_get_width (surface); return cairo_surface_reference (surface); case GTK_IMAGE_ICON_NAME: -<<<<<<< HEAD icon_name = gtk_image_get_icon_name (image); + size = gtk_image_get_icon_size (image); icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image))); gtk_icon_size_lookup (size, &width, NULL); *out_size = width; @@ -209,7 +211,7 @@ image_drag_data_received (GtkWidget *widget, break; case TARGET_TEXT: text = (gchar *)gtk_selection_data_get_text (selection_data); - gtk_image_set_from_icon_name (GTK_IMAGE (data), text, GTK_ICON_SIZE_DIALOG); + gtk_image_set_from_icon_name (GTK_IMAGE (data), text); g_free (text); break; default: @@ -223,7 +225,7 @@ make_image (const gchar *icon_name, int hotspot) { GtkWidget *image; - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name (icon_name); gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY); update_source_target_list (image); @@ -245,7 +247,7 @@ make_image2 (const gchar *icon_name, int hotspot) { GtkWidget *image; - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name (icon_name); gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY); update_source_target_list (image); diff --git a/tests/testemblems.c b/tests/testemblems.c index 849d0cffbe..cd28b39952 100644 --- a/tests/testemblems.c +++ b/tests/testemblems.c @@ -18,19 +18,19 @@ int main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (window), grid); icon = g_themed_icon_new ("folder"); - button = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU); + button = gtk_image_new_from_gicon (icon); gtk_grid_attach (GTK_GRID (grid), button, 1, 1, 1, 1); icon2 = g_themed_icon_new ("folder-symbolic"); - button = gtk_image_new_from_gicon (icon2, GTK_ICON_SIZE_MENU); + button = gtk_image_new_from_gicon (icon2); gtk_grid_attach (GTK_GRID (grid), button, 2, 1, 1, 1); icon = g_emblemed_icon_new (icon, g_emblem_new (g_themed_icon_new ("emblem-new"))); - button = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU); + button = gtk_image_new_from_gicon (icon); gtk_grid_attach (GTK_GRID (grid), button, 1, 2, 1, 1); icon2 = g_emblemed_icon_new (icon2, g_emblem_new (g_themed_icon_new ("emblem-new"))); - button = gtk_image_new_from_gicon (icon2, GTK_ICON_SIZE_MENU); + button = gtk_image_new_from_gicon (icon2); gtk_grid_attach (GTK_GRID (grid), button, 2, 2, 1, 1); gtk_widget_show (window); diff --git a/tests/testflowbox.c b/tests/testflowbox.c index c5ee16b92f..7721965c6c 100644 --- a/tests/testflowbox.c +++ b/tests/testflowbox.c @@ -169,7 +169,7 @@ populate_flowbox_images (GtkFlowBox *flowbox) widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_widget_set_hexpand (widget, TRUE); - image = gtk_image_new_from_icon_name ("face-wink", GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name ("face-wink"); gtk_widget_set_hexpand (image, TRUE); gtk_image_set_pixel_size (GTK_IMAGE (image), 256); diff --git a/tests/testgiconpixbuf.c b/tests/testgiconpixbuf.c index fd9ab1d558..6900f5e379 100644 --- a/tests/testgiconpixbuf.c +++ b/tests/testgiconpixbuf.c @@ -43,7 +43,7 @@ main (int argc, vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (hbox), vbox); - image = gtk_image_new_from_gicon (G_ICON (pixbuf), GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_gicon (G_ICON (pixbuf)); gtk_box_pack_start (GTK_BOX (vbox), image); label = gtk_label_new (NULL); @@ -58,7 +58,7 @@ main (int argc, vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (hbox), vbox); - image2 = gtk_image_new_from_gicon (emblemed, GTK_ICON_SIZE_DIALOG); + image2 = gtk_image_new_from_gicon (emblemed); gtk_box_pack_start (GTK_BOX (vbox), image2); label = gtk_label_new (NULL); diff --git a/tests/testgtk.c b/tests/testgtk.c index 254a5dd72e..b27ddb776c 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -1835,9 +1835,7 @@ create_image (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (window), vbox); - pack_image (vbox, "Stock Warning Dialog", - gtk_image_new_from_icon_name ("dialog-warning", - GTK_ICON_SIZE_DIALOG)); + pack_image (vbox, "Stock Warning Dialog", gtk_image_new_from_icon_name ("dialog-warning")); pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) openfile); @@ -2046,8 +2044,7 @@ create_menu (GdkDisplay *display, gint depth, gint length) group = NULL; - image = gtk_image_new_from_icon_name ("document-open", - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("document-open"); gtk_widget_show (image); menuitem = gtk_menu_item_new (); label = gtk_label_new ("Image Item"); @@ -2109,8 +2106,7 @@ create_table_menu (GdkDisplay *display, gint cols, gint rows) j++; /* now fill the items submenu */ - image = gtk_image_new_from_icon_name ("help-broswer", - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("help-broswer"); gtk_widget_show (image); G_GNUC_BEGIN_IGNORE_DEPRECATIONS; menuitem = gtk_menu_item_new (); @@ -2130,8 +2126,7 @@ create_table_menu (GdkDisplay *display, gint cols, gint rows) gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 1, 2); gtk_widget_show (menuitem); - image = gtk_image_new_from_icon_name ("help-browser", - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("help-browser"); gtk_widget_show (image); menuitem = gtk_menu_item_new (); label = gtk_label_new ("Image"); @@ -2340,8 +2335,7 @@ create_menus (GtkWidget *widget) gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem); gtk_widget_show (menuitem); - image = gtk_image_new_from_icon_name ("help-browser", - GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("help-browser"); gtk_widget_show (image); menuitem = gtk_menu_item_new (); label = gtk_label_new ("Help"); diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c index 7735c1b638..3f2bf3263e 100644 --- a/tests/testheaderbar.c +++ b/tests/testheaderbar.c @@ -109,7 +109,7 @@ change_header (GtkButton *button, gpointer data) gtk_header_bar_pack_end (GTK_HEADER_BAR (header), widget); widget= gtk_button_new (); - image = gtk_image_new_from_icon_name ("bookmark-new-symbolic", GTK_ICON_SIZE_BUTTON); + image = gtk_image_new_from_icon_name ("bookmark-new-symbolic"); g_signal_connect (widget, "clicked", G_CALLBACK (on_bookmark_clicked), window); gtk_container_add (GTK_CONTAINER (widget), image); @@ -159,7 +159,7 @@ main (int argc, char *argv[]) g_signal_connect (button, "clicked", G_CALLBACK (toggle_fullscreen), window); gtk_box_pack_end (GTK_BOX (box), footer); - content = gtk_image_new_from_icon_name ("start-here-symbolic", GTK_ICON_SIZE_DIALOG); + content = gtk_image_new_from_icon_name ("start-here-symbolic"); gtk_image_set_pixel_size (GTK_IMAGE (content), 512); gtk_box_pack_start (GTK_BOX (box), content); diff --git a/tests/testimage.c b/tests/testimage.c index e246635c6d..76b5eee3fe 100644 --- a/tests/testimage.c +++ b/tests/testimage.c @@ -132,21 +132,21 @@ main (int argc, char **argv) label = gtk_label_new ("GTK_IMAGE_ICON_NAME"); gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1); - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name (icon_name); gtk_grid_attach (GTK_GRID (grid), image, 1, 4, 1, 1); - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name (icon_name); gtk_image_set_pixel_size (GTK_IMAGE (image), 30); gtk_grid_attach (GTK_GRID (grid), image, 2, 4, 1, 1); label = gtk_label_new ("GTK_IMAGE_GICON"); gtk_grid_attach (GTK_GRID (grid), label, 0, 5, 1, 1); icon = g_themed_icon_new_with_default_fallbacks ("folder-remote"); - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_gicon (icon); g_object_unref (icon); gtk_grid_attach (GTK_GRID (grid), image, 1, 5, 1, 1); file = g_file_new_for_path ("apple-red.png"); icon = g_file_icon_new (file); - image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_gicon (icon); g_object_unref (icon); gtk_image_set_pixel_size (GTK_IMAGE (image), 30); gtk_grid_attach (GTK_GRID (grid), image, 2, 5, 1, 1); diff --git a/tests/testlist3.c b/tests/testlist3.c index aa99b342f7..171ecbe58a 100644 --- a/tests/testlist3.c +++ b/tests/testlist3.c @@ -86,7 +86,7 @@ create_row (const gchar *text) GtkTargetList *targets; row = gtk_list_box_row_new (); - image = gtk_image_new_from_icon_name ("open-menu-symbolic", 1); + image = gtk_image_new_from_icon_name ("open-menu-symbolic"); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); g_object_set (box, "margin-start", 10, "margin-end", 10, NULL); label = gtk_label_new (text); diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c index 3c44f3b19a..7a321428fa 100644 --- a/tests/testtoolbar.c +++ b/tests/testtoolbar.c @@ -557,7 +557,7 @@ main (gint argc, gchar **argv) add_item_to_list (store, item, "-----"); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); - image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG); + image = gtk_image_new_from_icon_name ("dialog-warning"); item = gtk_tool_item_new (); gtk_widget_show (image); gtk_container_add (GTK_CONTAINER (item), image); @@ -622,13 +622,13 @@ main (gint argc, gchar **argv) gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (item), TRUE); gicon = g_content_type_get_icon ("video/ogg"); - image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_LARGE_TOOLBAR); + image = gtk_image_new_from_gicon (gicon); g_object_unref (gicon); item = gtk_tool_button_new (image, "Video"); add_item_to_list (store, item, "Video"); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); - image = gtk_image_new_from_icon_name ("utilities-terminal", GTK_ICON_SIZE_LARGE_TOOLBAR); + image = gtk_image_new_from_icon_name ("utilities-terminal"); item = gtk_tool_button_new (image, "Terminal"); add_item_to_list (store, item, "Terminal"); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); diff --git a/tests/testtoplevelembed.c b/tests/testtoplevelembed.c index d3aaea9707..958b7f3c20 100644 --- a/tests/testtoplevelembed.c +++ b/tests/testtoplevelembed.c @@ -18,7 +18,7 @@ create_tab_label (GtkWidget *toplevel) GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); GtkWidget *label = gtk_label_new (G_OBJECT_TYPE_NAME (toplevel)); GtkWidget *button = gtk_button_new (); - GtkWidget *image = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_MENU); + GtkWidget *image = gtk_image_new_from_icon_name ("window-close"); gtk_container_add (GTK_CONTAINER (button), image); gtk_widget_set_hexpand (label, TRUE); |