props[PROP_LOGO] =
g_param_spec_object ("logo",
P_("Logo"),
- P_("A logo for the about box. If this is not set, it defaults to gtk_window_get_default_icon_list()"),
+ P_("A logo for the about box."),
GDK_TYPE_PAINTABLE,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
if (logo != NULL)
gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), logo);
- else
- {
- GList *surfaces = gtk_window_get_default_icon_list ();
-
- if (surfaces != NULL)
- {
- gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image),
- GDK_PAINTABLE (surfaces->data));
-
- g_list_free (surfaces);
- }
- }
g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO]);
const gchar *icon_name)
{
GtkAboutDialogPrivate *priv = gtk_about_dialog_get_instance_private (about);
- GList *icons;
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
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 ()))
- {
- gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), icons->data);
- g_list_free (icons);
- }
else
{
gtk_image_clear (GTK_IMAGE (priv->logo_image));
static GListStore *toplevel_list = NULL;
static guint window_signals[LAST_SIGNAL] = { 0 };
-static GList *default_icon_list = NULL;
static gchar *default_icon_name = NULL;
static guint default_icon_serial = 0;
static gboolean disable_startup_notification = FALSE;
icon_list = ensure_icon_info (priv->transient_parent)->icon_list;
if (icon_list)
info->using_parent_icon = TRUE;
- }
-
- /* Inherit from default */
- if (icon_list == NULL)
- {
- icon_list = default_icon_list;
- if (icon_list)
- info->using_default_icon = TRUE;
}
/* Look up themed icon */
return icon_from_list (info->icon_list, size);
}
- if (default_icon_list != NULL)
- return icon_from_list (default_icon_list, size);
-
if (default_icon_name != NULL)
return icon_from_name (default_icon_name, size);
return info->icon_name;
}
-/**
- * gtk_window_set_default_icon_list:
- * @list: (element-type GdkTexture) (transfer container): a list of #GdkTextures
- *
- * Sets an icon list to be used as fallback for windows that haven't
- * had gtk_window_set_icon_list() called on them to set up a
- * window-specific icon list. This function allows you to set up the
- * icon for all windows in your app at once.
- *
- * See gtk_window_set_icon_list() for more details.
- *
- **/
-void
-gtk_window_set_default_icon_list (GList *list)
-{
- GList *toplevels;
- GList *tmp_list;
- if (list == default_icon_list)
- return;
-
- /* Update serial so we don't used cached pixmaps/masks
- */
- default_icon_serial++;
-
- g_list_foreach (list,
- (GFunc) g_object_ref, NULL);
-
- g_list_free_full (default_icon_list, g_object_unref);
-
- default_icon_list = g_list_copy (list);
-
- /* Update all toplevels */
- toplevels = gtk_window_list_toplevels ();
- tmp_list = toplevels;
- while (tmp_list != NULL)
- {
- GtkWindowIconInfo *info;
- GtkWindow *w = tmp_list->data;
-
- info = get_icon_info (w);
- if (info && info->using_default_icon)
- {
- gtk_window_unrealize_icon (w);
- if (_gtk_widget_get_realized (GTK_WIDGET (w)))
- gtk_window_realize_icon (w);
- }
-
- tmp_list = tmp_list->next;
- }
- g_list_free (toplevels);
-}
-
/**
* gtk_window_set_default_icon_name:
* @name: the name of the themed icon
g_free (default_icon_name);
default_icon_name = g_strdup (name);
- g_list_free_full (default_icon_list, g_object_unref);
- default_icon_list = NULL;
-
/* Update all toplevels */
toplevels = gtk_window_list_toplevels ();
tmp_list = toplevels;
return default_icon_name;
}
-/**
- * gtk_window_get_default_icon_list:
- *
- * Gets the value set by gtk_window_set_default_icon_list().
- * The list is a copy and should be freed with g_list_free(),
- * but the surfaces in the list have not had their reference count
- * incremented.
- *
- * Returns: (element-type GdkTexture) (transfer container): copy of default icon list
- **/
-GList*
-gtk_window_get_default_icon_list (void)
-{
- return g_list_copy (default_icon_list);
-}
-
#define INCLUDE_CSD_SIZE 1
#define EXCLUDE_CSD_SIZE -1