[libgda] Replace (deprecated) gtk_paint_hline() with gtk_render_line().



commit 15d689befdeb6727d9f5a6ed7c02517e34bba829
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Jul 4 13:04:00 2011 +0200

    Replace (deprecated) gtk_paint_hline() with gtk_render_line().
    
    This deprecation happened in GTK+ 3.0.

 .../data-entries/gdaui-data-cell-renderer-bin.c    |   14 +++++---------
 .../gdaui-data-cell-renderer-boolean.c             |   14 ++++++--------
 .../data-entries/gdaui-data-cell-renderer-combo.c  |   14 +++++---------
 .../gdaui-data-cell-renderer-textual.c             |   14 +++++---------
 .../plugins/gdaui-data-cell-renderer-password.c    |   14 +++++---------
 .../plugins/gdaui-data-cell-renderer-pict.c        |   14 +++++---------
 6 files changed, 31 insertions(+), 53 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
index ac625b4..753601d 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
@@ -370,19 +370,15 @@ gdaui_data_cell_renderer_bin_render (GtkCellRenderer      *cell,
 	(pixbuf_class->render) (cell, cr, widget, background_area, cell_area, flags);
 	
 	if (datacell->priv->to_be_deleted) {
-		GtkStyle *style;
+		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
 		guint xpad;
-		
-		g_object_get ((GObject*) widget, "style", &style, NULL);
 		g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
 
-		gtk_paint_hline (style,
-				 cr, GTK_STATE_SELECTED,
-				 widget,
-				 "hline",
+		gdouble y = cell_area->y + cell_area->height / 2.;
+		gtk_render_line (style_context,
+				 cr,
 				 cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
-				 cell_area->y + cell_area->height / 2.);
-		g_object_unref (style);
+				 y, y);
 	}
 	if (datacell->priv->invalid)
 		gdaui_data_cell_renderer_draw_invalid_area (cr, cell_area);
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c
index 4a90445..2ca2ef9 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c
@@ -376,16 +376,14 @@ gdaui_data_cell_renderer_boolean_render (GtkCellRenderer      *cell,
 	(toggle_class->render) (cell, cr, widget, background_area, cell_area, flags);
 
 	if (datacell->priv->to_be_deleted) {
-		GtkStyle *style;
+		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
 		guint xpad;
-
-		g_object_get (G_OBJECT(widget), "style", &style, "xpad", &xpad, NULL);
-		gtk_paint_hline (style,
-				 cr, GTK_STATE_SELECTED,
-				 widget,
-				 "hline",
+		g_object_get (G_OBJECT(widget), "xpad", &xpad, NULL);
+		gdouble y = cell_area->y + cell_area->height / 2.;
+		gtk_render_line (style_context,
+				 cr,
 				 cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
-				 cell_area->y + cell_area->height / 2.);
+				 y, y);
 
 	}
 	if (datacell->priv->invalid)
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
index b72ffe2..862323e 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
@@ -540,19 +540,15 @@ gdaui_data_cell_renderer_combo_render (GtkCellRenderer      *cell,
 	}
 
 	if (combocell->priv->to_be_deleted) {
-		GtkStyle *style;
+		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
 		guint xpad;
-
-		g_object_get ((GObject*) widget, "style", &style, NULL);
 		g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
 
-		gtk_paint_hline (style,
-				 cr, GTK_STATE_SELECTED,
-				 widget,
-				 "hline",
+		gdouble y = cell_area->y + cell_area->height / 2.;
+		gtk_render_line (style_context,
+				 cr,
 				 cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
-				 cell_area->y + cell_area->height / 2.);
-		g_object_unref (style);
+				 y, y);
 	}
 
 	if (combocell->priv->invalid)
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c
index 3589e73..e4d4ee7 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c
@@ -626,19 +626,15 @@ gdaui_data_cell_renderer_textual_render (GtkCellRenderer      *cell,
 	(text_class->render) (cell, cr, widget, background_area, cell_area, flags);
 
 	if (datacell->priv->to_be_deleted) {
-		GtkStyle *style;
+		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
 		guint xpad;
-
-		g_object_get ((GObject*) widget, "style", &style, NULL);
 		g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
 
-		gtk_paint_hline (style,
-				 cr, GTK_STATE_SELECTED,
-				 widget,
-				 "hline",
+		gdouble y = cell_area->y + cell_area->height / 2.;
+		gtk_render_line (style_context,
+				 cr,
 				 cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
-				 cell_area->y + cell_area->height / 2.);
-		g_object_unref (style);
+				 y, y);
 	}
 	if (datacell->priv->invalid)
 		gdaui_data_cell_renderer_draw_invalid_area (cr, cell_area);
diff --git a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c
index a8afa22..6f5eedf 100644
--- a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c
+++ b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c
@@ -386,19 +386,15 @@ gdaui_data_cell_renderer_password_render (GtkCellRenderer      *cell,
 	(text_class->render) (cell, cr, widget, background_area, cell_area, flags);
 
 	if (datacell->priv->to_be_deleted) {
-		GtkStyle *style;
+		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
 		guint xpad;
-
-		g_object_get ((GObject*) widget, "style", &style, NULL);
 		g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
 
-		gtk_paint_hline (style,
-				 cr, GTK_STATE_SELECTED,
-				 widget,
-				 "hline",
+		gdouble y = cell_area->y + cell_area->height / 2.;
+		gtk_render_line (style_context,
+				 cr
 				 cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
-				 cell_area->y + cell_area->height / 2.);
-		g_object_unref (style);
+				 y, y);
 	}
 	if (datacell->priv->invalid)
 		gdaui_data_cell_renderer_draw_invalid_area (cr, cell_area);
diff --git a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c
index 0503d1d..d3e1cab 100644
--- a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c
+++ b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c
@@ -405,19 +405,15 @@ gdaui_data_cell_renderer_pict_render (GtkCellRenderer      *cell,
 	(pixbuf_class->render) (cell, cr, widget, background_area, cell_area, flags);
 
 	if (datacell->priv->to_be_deleted) {
-		GtkStyle *style;
+		GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
 		guint xpad;
-
-		g_object_get ((GObject*) widget, "style", &style, NULL);
 		g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
 
-		gtk_paint_hline (style,
-				 cr, GTK_STATE_SELECTED,
-				 widget,
-				 "hline",
+		gdouble y = cell_area->y + cell_area->height / 2.;
+		gtk_render_line (style_context,
+				 cr,
 				 cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
-				 cell_area->y + cell_area->height / 2.);
-		g_object_unref (style);
+				 y, y);
 	}
 	if (datacell->priv->invalid)
 		gdaui_data_cell_renderer_draw_invalid_area (cr, cell_area);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]