X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkcellview.c;h=d5d33ede3221e98c238da93eb3607c0dba842931;hb=e54f8f4c623182b6870b27ef283cae2e71749662;hp=4a86a931a24df07254a38a3dffbf546be6f9a7a9;hpb=ee669a1b519ad3054e5fbc4ed7a37ea2ecc41b08;p=~andy%2Fgtk diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c index 4a86a931a..d5d33ede3 100644 --- a/gtk/gtkcellview.c +++ b/gtk/gtkcellview.c @@ -12,9 +12,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -192,15 +190,23 @@ gtk_cell_view_class_init (GtkCellViewClass *klass) P_("Background color as a string"), NULL, GTK_PARAM_WRITABLE)); + + /** + * GtkCellView:background-gdk: + * + * The background color as a #GdkColor + * + * Deprecated: 3.4: Use #GtkCellView:background-rgba instead. + */ g_object_class_install_property (gobject_class, PROP_BACKGROUND_GDK, g_param_spec_boxed ("background-gdk", P_("Background color"), P_("Background color as a GdkColor"), GDK_TYPE_COLOR, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE | G_PARAM_DEPRECATED)); /** - * GtkCellView:background-rgba + * GtkCellView:background-rgba: * * The background color as a #GdkRGBA * @@ -215,7 +221,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass) GTK_PARAM_READWRITE)); /** - * GtkCellView:model + * GtkCellView:model: * * The model for cell view * @@ -231,7 +237,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass) /** - * GtkCellView:cell-area + * GtkCellView:cell-area: * * The #GtkCellArea rendering cells * @@ -249,7 +255,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass) GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** - * GtkCellView:cell-area-context + * GtkCellView:cell-area-context: * * The #GtkCellAreaContext used to compute the geometry of the cell view. * @@ -274,7 +280,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass) GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** - * GtkCellView:draw-sensitive + * GtkCellView:draw-sensitive: * * Whether all cells should be draw as sensitive for this view regardless * of the actual cell properties (used to make menus with submenus appear @@ -292,7 +298,7 @@ gtk_cell_view_class_init (GtkCellViewClass *klass) GTK_PARAM_READWRITE)); /** - * GtkCellView:fit-model + * GtkCellView:fit-model: * * Whether the view should request enough space to always fit * the size of every row in the model (used by the combo box to @@ -440,20 +446,33 @@ gtk_cell_view_set_property (GObject *object, break; case PROP_BACKGROUND: { - GdkColor color; - + GdkRGBA color; + if (!g_value_get_string (value)) - gtk_cell_view_set_background_color (view, NULL); - else if (gdk_color_parse (g_value_get_string (value), &color)) - gtk_cell_view_set_background_color (view, &color); + gtk_cell_view_set_background_rgba (view, NULL); + else if (gdk_rgba_parse (&color, g_value_get_string (value))) + gtk_cell_view_set_background_rgba (view, &color); else g_warning ("Don't know color `%s'", g_value_get_string (value)); - - g_object_notify (object, "background-gdk"); + + g_object_notify (object, "background-rgba"); + g_object_notify (object, "background-gdk"); } break; case PROP_BACKGROUND_GDK: - gtk_cell_view_set_background_color (view, g_value_get_boxed (value)); + { + GdkColor *color; + GdkRGBA rgba; + + color = g_value_get_boxed (value); + + rgba.red = color->red / 65535.0; + rgba.green = color->green / 65535.0; + rgba.blue = color->blue / 65535.0; + rgba.alpha = 1.0; + + gtk_cell_view_set_background_rgba (view, &rgba); + } break; case PROP_BACKGROUND_RGBA: gtk_cell_view_set_background_rgba (view, g_value_get_boxed (value)); @@ -577,7 +596,7 @@ gtk_cell_view_size_allocate (GtkWidget *widget, /* The first cell view in context is responsible for allocating the context at allocate time * (or the cellview has its own context and is not grouped with any other cell views) * - * If the cellview is in "fit model" mode, we assume its not in context and needs to + * If the cellview is in "fit model" mode, we assume it's not in context and needs to * allocate every time. */ if (priv->fit_model) @@ -974,7 +993,7 @@ gtk_cell_view_new_with_context (GtkCellArea *area, * @text: the text to display in the cell view * * Creates a new #GtkCellView widget, adds a #GtkCellRendererText - * to it, and makes its show @text. + * to it, and makes it show @text. * * Return value: A newly created #GtkCellView widget. * @@ -1039,8 +1058,8 @@ gtk_cell_view_new_with_markup (const gchar *markup) * gtk_cell_view_new_with_pixbuf: * @pixbuf: the image to display in the cell view * - * Creates a new #GtkCellView widget, adds a #GtkCellRendererPixbuf - * to it, and makes its show @pixbuf. + * Creates a new #GtkCellView widget, adds a #GtkCellRendererPixbuf + * to it, and makes it show @pixbuf. * * Return value: A newly created #GtkCellView widget. * @@ -1267,6 +1286,8 @@ gtk_cell_view_get_size_of_row (GtkCellView *cell_view, * Sets the background color of @view. * * Since: 2.6 + * + * Deprecated: 3.4: Use gtk_cell_view_set_background_rgba() instead. */ void gtk_cell_view_set_background_color (GtkCellView *cell_view,