diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-15 23:12:24 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-26 21:49:12 +0800 |
commit | 0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a (patch) | |
tree | a26500015888bcbc66f879e629f114875fbc4498 /widgets/table | |
parent | b44f49abe70bf94e3bc268eff0a4569353d09a9a (diff) | |
download | gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.tar gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.tar.gz gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.tar.bz2 gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.tar.lz gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.tar.xz gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.tar.zst gsoc2013-evolution-0edd064412cdd2b5f0d264fe2553f6a1e86c3c0a.zip |
Adapt ETableFieldChooserItem to latest gtk+-3.0 API.
Diffstat (limited to 'widgets/table')
-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; } |