diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-15 23:12:24 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:27 +0800 |
commit | 0dd0f9b28f962837e847ed57ad4ee0c0f9b77038 (patch) | |
tree | d3bd93a8329adbe47fb00c0b240962221bd71508 /widgets | |
parent | 1da19002512b38e6507d0c4d6098fe40c9fe561a (diff) | |
download | gsoc2013-evolution-0dd0f9b28f962837e847ed57ad4ee0c0f9b77038.tar.gz gsoc2013-evolution-0dd0f9b28f962837e847ed57ad4ee0c0f9b77038.tar.zst gsoc2013-evolution-0dd0f9b28f962837e847ed57ad4ee0c0f9b77038.zip |
Adapt ETableFieldChooserItem to latest gtk+-3.0 API.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-table-field-chooser-item.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 7a87db4302..411c1b58f4 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -466,7 +466,7 @@ etfci_unrealize (GnomeCanvasItem *item) static void etfci_draw (GnomeCanvasItem *item, - GdkDrawable *drawable, + cairo_t *cr, gint x, gint y, gint width, @@ -505,13 +505,17 @@ etfci_draw (GnomeCanvasItem *item, if (y2 < y) continue; - e_table_header_draw_button (drawable, ecol, + cairo_save (cr); + + e_table_header_draw_button (cr, ecol, style, state, GTK_WIDGET (canvas), -x, y1 - y, width, height, etfci->width, y2 - y1, E_TABLE_COL_ARROW_NONE); + + cairo_restore (cr); } } @@ -544,9 +548,11 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo GtkStyle *style; GtkStateType state; ETableCol *ecol; - GdkPixmap *pixmap; + cairo_surface_t *cs; + cairo_t *cr; gint drag_col; gint button_height; + GdkPixbuf *pixbuf; GtkTargetEntry etfci_drag_types[] = { { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, @@ -576,26 +582,29 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo button_height = e_table_header_compute_height (ecol, widget); window = gtk_widget_get_window (widget); - pixmap = gdk_pixmap_new (window, etfci->width, button_height, -1); + cs = gdk_window_create_similar_surface (window, CAIRO_CONTENT_COLOR, etfci->width, button_height); style = gtk_widget_get_style (widget); state = gtk_widget_get_state (widget); + cr = cairo_create (cs); e_table_header_draw_button ( - pixmap, ecol, style, + cr, ecol, style, state, widget, 0, 0, etfci->width, button_height, etfci->width, button_height, E_TABLE_COL_ARROW_NONE); - gtk_drag_set_icon_pixmap ( + pixbuf = gdk_pixbuf_get_from_window (window, 0, 0, etfci->width, button_height); + gtk_drag_set_icon_pixbuf ( context, - gdk_drawable_get_colormap (GDK_DRAWABLE (window)), - pixmap, NULL, + pixbuf, etfci->width / 2, button_height / 2); + g_object_unref (pixbuf); - g_object_unref (pixmap); + cairo_surface_destroy (cs); + cairo_destroy (cr); etfci->maybe_drag = FALSE; } |