summaryrefslogtreecommitdiff
path: root/baobab
diff options
context:
space:
mode:
Diffstat (limited to 'baobab')
-rw-r--r--baobab/src/baobab-cell-renderer-progress.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/baobab/src/baobab-cell-renderer-progress.c b/baobab/src/baobab-cell-renderer-progress.c
index 882c43c2..91fbe440 100644
--- a/baobab/src/baobab-cell-renderer-progress.c
+++ b/baobab/src/baobab-cell-renderer-progress.c
@@ -99,7 +99,11 @@ baobab_cell_renderer_progress_set_property (GObject *object,
static void
baobab_cell_renderer_progress_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ const GdkRectangle *cell_area,
+#else
GdkRectangle *cell_area,
+#endif
gint *x_offset,
gint *y_offset,
gint *width,
@@ -183,25 +187,38 @@ set_color_according_to_perc (cairo_t *cr, double value)
static void
baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ cairo_t *cr,
+#else
GdkWindow *window,
+#endif
GtkWidget *widget,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
+#else
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
+#endif
guint flags)
{
BaobabCellRendererProgress *cellprogress = BAOBAB_CELL_RENDERER_PROGRESS (cell);
gint x, y, w, h, perc_w;
gboolean is_rtl;
+#if !GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr;
+#endif
gint xpad;
gint ypad;
GtkStyle *style;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
-
+
+#if !GTK_CHECK_VERSION (3, 0, 0)
cr = gdk_cairo_create (window);
-
+#endif
+
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
x = cell_area->x + xpad;
@@ -236,8 +253,10 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
cairo_rectangle (cr, is_rtl ? (x + w - perc_w) : x, y, perc_w, h);
set_color_according_to_perc (cr, cellprogress->priv->perc);
cairo_fill (cr);
-
+
+#if !GTK_CHECK_VERSION (3, 0, 0)
cairo_destroy (cr);
+#endif
}
static void