diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-12-01 10:26:51 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-12-01 10:36:17 -0500 |
commit | 4930153413546ddbf0c9fd3a83ac9a961fa87a62 (patch) | |
tree | f08d33c70e7767be1c9b8cbbbd2940600ef6d90c /gtk/gtkcellrendererpixbuf.c | |
parent | 1c59db9bfffc31bbbf57fb60127cbc3a7b8b9754 (diff) | |
download | gtk+-4930153413546ddbf0c9fd3a83ac9a961fa87a62.tar.gz |
Finish conversion of pixbuf cell renderer icon size
Change the name of the property from stock-size to icon-size,
and make it an enum property instead of uint. This makes it
impossible to specify invalid numeric values in ui files, and
at the same time makes it possible to refer to the existing
values by their nick.
Fix up the callers.
Diffstat (limited to 'gtk/gtkcellrendererpixbuf.c')
-rw-r--r-- | gtk/gtkcellrendererpixbuf.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index b9cce687b2..d6a610c0a3 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -77,8 +77,7 @@ enum { PROP_PIXBUF_EXPANDER_CLOSED, PROP_SURFACE, PROP_TEXTURE, - PROP_STOCK_SIZE, - PROP_STOCK_DETAIL, + PROP_ICON_SIZE, PROP_ICON_NAME, PROP_GICON }; @@ -186,19 +185,18 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class) GTK_PARAM_READWRITE)); /** - * GtkCellRendererPixbuf:stock-size: + * GtkCellRendererPixbuf:icon-size: * * The #GtkIconSize value that specifies the size of the rendered icon. * - * Since: 2.2 + * Since: 3.94 */ g_object_class_install_property (object_class, - PROP_STOCK_SIZE, - g_param_spec_uint ("stock-size", - P_("Size"), + PROP_ICON_SIZE, + g_param_spec_enum ("icon-size", + P_("Icon Size"), P_("The GtkIconSize value that specifies the size of the rendered icon"), - 0, - G_MAXUINT, + GTK_TYPE_ICON_SIZE, GTK_ICON_SIZE_INHERIT, GTK_PARAM_READWRITE)); @@ -206,8 +204,7 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class) * GtkCellRendererPixbuf:icon-name: * * The name of the themed icon to display. - * This property only has an effect if not overridden by "stock_id" - * or "pixbuf" properties. + * This property only has an effect if not overridden by the "pixbuf" property. * * Since: 2.8 */ @@ -278,8 +275,8 @@ gtk_cell_renderer_pixbuf_get_property (GObject *object, case PROP_TEXTURE: g_value_set_object (value, gtk_image_definition_get_texture (priv->image_def)); break; - case PROP_STOCK_SIZE: - g_value_set_uint (value, priv->icon_size); + case PROP_ICON_SIZE: + g_value_set_enum (value, priv->icon_size); break; case PROP_ICON_NAME: g_value_set_string (value, gtk_image_definition_get_icon_name (priv->image_def)); @@ -375,8 +372,8 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, case PROP_TEXTURE: take_image_definition (cellpixbuf, gtk_image_definition_new_texture (g_value_get_object (value))); break; - case PROP_STOCK_SIZE: - priv->icon_size = g_value_get_uint (value); + case PROP_ICON_SIZE: + priv->icon_size = g_value_get_enum (value); break; case PROP_ICON_NAME: take_image_definition (cellpixbuf, gtk_image_definition_new_icon_name (g_value_get_string (value))); |