window: Remove icon property

This commit is contained in:
Timm Bäder 2018-12-30 06:32:31 +01:00 committed by Matthias Clasen
parent 79664567c4
commit 490bb4c2ea
2 changed files with 0 additions and 92 deletions

View File

@ -323,7 +323,6 @@ enum {
PROP_DEFAULT_HEIGHT, PROP_DEFAULT_HEIGHT,
PROP_DESTROY_WITH_PARENT, PROP_DESTROY_WITH_PARENT,
PROP_HIDE_ON_CLOSE, PROP_HIDE_ON_CLOSE,
PROP_ICON,
PROP_ICON_NAME, PROP_ICON_NAME,
PROP_DISPLAY, PROP_DISPLAY,
PROP_TYPE_HINT, PROP_TYPE_HINT,
@ -912,15 +911,6 @@ gtk_window_class_init (GtkWindowClass *klass)
P_("If this window should be hidden when the user clicks the close button"), P_("If this window should be hidden when the user clicks the close button"),
FALSE, FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
window_props[PROP_ICON] =
g_param_spec_object ("icon",
P_("Icon"),
P_("Icon for this window"),
GDK_TYPE_TEXTURE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/** /**
* GtkWindow:mnemonics-visible: * GtkWindow:mnemonics-visible:
* *
@ -2053,10 +2043,6 @@ gtk_window_set_property (GObject *object,
case PROP_HIDE_ON_CLOSE: case PROP_HIDE_ON_CLOSE:
gtk_window_set_hide_on_close (window, g_value_get_boolean (value)); gtk_window_set_hide_on_close (window, g_value_get_boolean (value));
break; break;
case PROP_ICON:
gtk_window_set_icon (window,
g_value_get_object (value));
break;
case PROP_ICON_NAME: case PROP_ICON_NAME:
gtk_window_set_icon_name (window, g_value_get_string (value)); gtk_window_set_icon_name (window, g_value_get_string (value));
break; break;
@ -2167,9 +2153,6 @@ gtk_window_get_property (GObject *object,
case PROP_HIDE_ON_CLOSE: case PROP_HIDE_ON_CLOSE:
g_value_set_boolean (value, priv->hide_on_close); g_value_set_boolean (value, priv->hide_on_close);
break; break;
case PROP_ICON:
g_value_set_object (value, gtk_window_get_icon (window));
break;
case PROP_ICON_NAME: case PROP_ICON_NAME:
g_value_set_string (value, gtk_window_get_icon_name (window)); g_value_set_string (value, gtk_window_get_icon_name (window));
break; break;
@ -4770,8 +4753,6 @@ gtk_window_set_icon_list (GtkWindow *window,
info->icon_list = g_list_copy (list); info->icon_list = g_list_copy (list);
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ICON]);
gtk_window_unrealize_icon (window); gtk_window_unrealize_icon (window);
if (_gtk_widget_get_realized (GTK_WIDGET (window))) if (_gtk_widget_get_realized (GTK_WIDGET (window)))
@ -4808,50 +4789,6 @@ gtk_window_get_icon_list (GtkWindow *window)
return NULL; return NULL;
} }
/**
* gtk_window_set_icon:
* @window: a #GtkWindow
* @icon: (allow-none): icon image, or %NULL
*
* Sets up the icon representing a #GtkWindow. This icon is used when
* the window is minimized (also known as iconified). Some window
* managers or desktop environments may also place it in the window
* frame, or display it in other contexts. On others, the icon is not
* used at all, so your mileage may vary.
*
* The icon should be provided in whatever size it was naturally
* drawn; that is, dont scale the image before passing it to
* GTK+. Scaling is postponed until the last minute, when the desired
* final size is known, to allow best quality.
*
* If you have your icon hand-drawn in multiple sizes, use
* gtk_window_set_icon_list(). Then the best size will be used.
*
* This function is equivalent to calling gtk_window_set_icon_list()
* with a 1-element list.
*
* See also gtk_window_set_default_icon_list() to set the icon
* for all windows in your application in one go.
**/
void
gtk_window_set_icon (GtkWindow *window,
GdkTexture *icon)
{
GList *list;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (icon == NULL || GDK_IS_TEXTURE (icon));
list = NULL;
if (icon)
list = g_list_append (list, icon);
gtk_window_set_icon_list (window, list);
g_list_free (list);
}
static void static void
update_themed_icon (GtkWindow *window) update_themed_icon (GtkWindow *window)
{ {
@ -4923,30 +4860,6 @@ gtk_window_get_icon_name (GtkWindow *window)
return info->icon_name; return info->icon_name;
} }
/**
* gtk_window_get_icon:
* @window: a #GtkWindow
*
* Gets the value set by gtk_window_set_icon() (or if you've
* called gtk_window_set_icon_list(), gets the first icon in
* the icon list).
*
* Returns: (transfer none) (nullable): icon for window or %NULL if none
**/
GdkTexture *
gtk_window_get_icon (GtkWindow *window)
{
GtkWindowIconInfo *info;
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
info = get_icon_info (window);
if (info && info->icon_list)
return (GdkTexture *) (info->icon_list->data);
else
return NULL;
}
/** /**
* gtk_window_set_default_icon_list: * gtk_window_set_default_icon_list:
* @list: (element-type GdkTexture) (transfer container): a list of #GdkTextures * @list: (element-type GdkTexture) (transfer container): a list of #GdkTextures

View File

@ -278,14 +278,9 @@ void gtk_window_set_icon_list (GtkWindow *window,
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GList* gtk_window_get_icon_list (GtkWindow *window); GList* gtk_window_get_icon_list (GtkWindow *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_window_set_icon (GtkWindow *window,
GdkTexture *icon);
GDK_AVAILABLE_IN_ALL
void gtk_window_set_icon_name (GtkWindow *window, void gtk_window_set_icon_name (GtkWindow *window,
const gchar *name); const gchar *name);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkTexture * gtk_window_get_icon (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
const gchar * gtk_window_get_icon_name (GtkWindow *window); const gchar * gtk_window_get_icon_name (GtkWindow *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_window_set_default_icon_list (GList *list); void gtk_window_set_default_icon_list (GList *list);