[libgda/LIBGDA_4.2] GdaBrowser: scale grid widgets by changing font size



commit 12a85fec9ebccabbae3818bf2ccb7c62d42924ed
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sun Jul 24 20:16:12 2011 +0200

    GdaBrowser: scale grid widgets by changing font size

 tools/browser/common/ui-formgrid.c       |   10 ++++++++++
 tools/browser/data-manager/data-widget.c |   10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/tools/browser/common/ui-formgrid.c b/tools/browser/common/ui-formgrid.c
index 1718b1c..bf3dfcb 100644
--- a/tools/browser/common/ui-formgrid.c
+++ b/tools/browser/common/ui-formgrid.c
@@ -236,6 +236,16 @@ ui_formgrid_init (UiFormGrid *formgrid)
 	g_signal_connect (formgrid->priv->raw_grid, "populate-popup",
 			  G_CALLBACK (form_grid_populate_popup_cb), formgrid);
 
+	PangoContext *pc;
+	PangoFontDescription *fd, *fdc;
+	pc = gtk_widget_get_pango_context (formgrid->priv->raw_grid);
+	fd = pango_context_get_font_description (pc);
+	fdc = pango_font_description_copy (fd);
+	pango_font_description_set_size (fdc,
+					 pango_font_description_get_size (fd) * .8);
+	gtk_widget_modify_font (formgrid->priv->raw_grid, fdc);
+	pango_font_description_free (fdc);
+
 	/* form on the 2nd page of the notebook */
 	formgrid->priv->raw_form = gdaui_raw_form_new (NULL);
 	gdaui_data_proxy_column_show_actions (GDAUI_DATA_PROXY (formgrid->priv->raw_form), -1, FALSE);
diff --git a/tools/browser/data-manager/data-widget.c b/tools/browser/data-manager/data-widget.c
index 7860129..b8a56c2 100644
--- a/tools/browser/data-manager/data-widget.c
+++ b/tools/browser/data-manager/data-widget.c
@@ -688,16 +688,6 @@ customize_form_grid (UiFormGrid *cwid)
 		gtk_widget_show (header);
 		gtk_tree_view_column_set_widget (GTK_TREE_VIEW_COLUMN (list->data),
 						 header);
-		
-		/* reduce text's size */
-		GList *renderers, *list2;
-		renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (list->data));
-		for (list2 = renderers; list2; list2 = list2->next) {
-			if (GTK_IS_CELL_RENDERER_TEXT (list2->data))
-				g_object_set ((GObject*) list2->data,
-					      "scale", 0.8, NULL);
-		}
-		g_list_free (renderers);
 	}
 	
 	/*if (!columns || !columns->next)*/



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