[gimp/gtk3-port: 233/234] libgimpwidgets, app: use GdkRGBA instead of GdkColor for cell backgrounds
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 233/234] libgimpwidgets, app: use GdkRGBA instead of GdkColor for cell backgrounds
- Date: Fri, 10 Feb 2017 00:00:58 +0000 (UTC)
commit db3f5786f6a9333783b7d42a7d537b09f7afd666
Author: Michael Natterer <mitch gimp org>
Date: Tue Nov 1 12:50:10 2016 +0100
libgimpwidgets, app: use GdkRGBA instead of GdkColor for cell backgrounds
app/widgets/gimpitemtreeview.c | 14 ++++----------
libgimpwidgets/gimpcellrenderertoggle.c | 10 ++++------
2 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index 7267ce2..678b5f6 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -332,7 +332,7 @@ gimp_item_tree_view_init (GimpItemTreeView *view)
view->priv->model_column_color_tag =
gimp_container_tree_store_columns_add (tree_view->model_columns,
&tree_view->n_model_columns,
- GDK_TYPE_COLOR);
+ GDK_TYPE_RGBA);
gimp_container_tree_view_set_dnd_drop_to_empty (tree_view, TRUE);
@@ -380,7 +380,7 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->model_column_visible,
"inconsistent",
item_view->priv->model_column_viewable,
- "cell-background-gdk",
+ "cell-background-rgba",
item_view->priv->model_column_color_tag,
NULL);
@@ -978,7 +978,6 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
GimpItem *item = GIMP_ITEM (viewable);
GtkTreeIter *iter;
GimpRGB color;
- GdkColor gdk_color;
gboolean has_color;
item_view->priv->inserting_item = TRUE;
@@ -990,8 +989,6 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
has_color = gimp_get_color_tag_color (gimp_item_get_color_tag (item),
&color);
- if (has_color)
- gimp_rgb_get_gdk_color (&color, &gdk_color);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
item_view->priv->model_column_visible,
@@ -1002,7 +999,7 @@ gimp_item_tree_view_insert_item (GimpContainerView *view,
item_view->priv->model_column_linked,
gimp_item_get_linked (item),
item_view->priv->model_column_color_tag,
- has_color ? &gdk_color : NULL,
+ has_color ? (GdkRGBA *) &color : NULL,
-1);
return iter;
@@ -1405,17 +1402,14 @@ gimp_item_tree_view_color_tag_changed (GimpItem *item,
if (iter)
{
GimpRGB color;
- GdkColor gdk_color;
gboolean has_color;
has_color = gimp_get_color_tag_color (gimp_item_get_color_tag (item),
&color);
- if (has_color)
- gimp_rgb_get_gdk_color (&color, &gdk_color);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
view->priv->model_column_color_tag,
- has_color ? &gdk_color : NULL,
+ has_color ? (GdkRGBA *) &color : NULL,
-1);
}
}
diff --git a/libgimpwidgets/gimpcellrenderertoggle.c b/libgimpwidgets/gimpcellrenderertoggle.c
index b21974e..6d5b4bb 100644
--- a/libgimpwidgets/gimpcellrenderertoggle.c
+++ b/libgimpwidgets/gimpcellrenderertoggle.c
@@ -393,19 +393,17 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
if (background_set)
{
- cairo_t *cr = gdk_cairo_create (window);
- GdkColor *color;
+ GdkRGBA *color;
g_object_get (cell,
- "cell-background-gdk", &color,
+ "cell-background-rgba", &color,
NULL);
gdk_cairo_rectangle (cr, background_area);
- gdk_cairo_set_source_color (cr, color);
+ gdk_cairo_set_source_rgba (cr, color);
cairo_fill (cr);
- gdk_color_free (color);
- cairo_destroy (cr);
+ gdk_rgba_free (color);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]