[evolution-data-server] source-viewer: Refactor the cell renderers.



commit 76a057a301dcca43af16b380b6d00f21387f33ca
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jun 11 09:40:20 2012 -0400

    source-viewer: Refactor the cell renderers.

 tests/libedataserverui/evolution-source-viewer.c |   24 +++++++++++++--------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/tests/libedataserverui/evolution-source-viewer.c b/tests/libedataserverui/evolution-source-viewer.c
index 3244540..169c88e 100644
--- a/tests/libedataserverui/evolution-source-viewer.c
+++ b/tests/libedataserverui/evolution-source-viewer.c
@@ -434,6 +434,7 @@ source_viewer_constructed (GObject *object)
 	ESourceViewer *viewer;
 	GtkTreeViewColumn *column;
 	GtkTreeSelection *selection;
+	GtkCellRenderer *renderer;
 	GtkWidget *container;
 	GtkWidget *paned;
 	GtkWidget *widget;
@@ -474,19 +475,24 @@ source_viewer_constructed (GObject *object)
 	viewer->tree_view = widget;  /* do not reference */
 	gtk_widget_show (widget);
 
-	column = gtk_tree_view_column_new_with_attributes (
-		_("Display Name"),
-		gtk_cell_renderer_text_new (),
-		"text", COLUMN_DISPLAY_NAME, NULL);
-	gtk_tree_view_column_set_expand (column, TRUE);
+	column = gtk_tree_view_column_new ();
+	gtk_tree_view_column_set_title (column, _("Display Name"));
 	gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column);
 
-	column = gtk_tree_view_column_new_with_attributes (
-		_("Identity"),
-		gtk_cell_renderer_text_new (),
-		"text", COLUMN_SOURCE_UID, NULL);
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_tree_view_column_pack_start (column, renderer, TRUE);
+	gtk_tree_view_column_add_attribute (
+		column, renderer, "text", COLUMN_DISPLAY_NAME);
+
+	column = gtk_tree_view_column_new ();
+	gtk_tree_view_column_set_title (column, _("Identity"));
 	gtk_tree_view_append_column (GTK_TREE_VIEW (widget), column);
 
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_tree_view_column_pack_start (column, renderer, FALSE);
+	gtk_tree_view_column_add_attribute (
+		column, renderer, "text", COLUMN_SOURCE_UID);
+
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
 
 	/* Right panel */



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