[gnome-color-manager] trivial: Ensure the devices and profiles scrolled windows always wrap in the correct place



commit a0f149170622a2353096597644befe2301bcf5d2
Author: Richard Hughes <richard hughsie com>
Date:   Mon Apr 19 15:11:58 2010 +0100

    trivial: Ensure the devices and profiles scrolled windows always wrap in the correct place

 data/gcm-prefs.ui |    4 ++--
 src/gcm-prefs.c   |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index 3fd8c54..591d7b4 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -41,7 +41,7 @@
                               <object class="GtkScrolledWindow" id="scrolledwindow1">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="hscrollbar_policy">never</property>
+                                <property name="hscrollbar_policy">automatic</property>
                                 <property name="vscrollbar_policy">automatic</property>
                                 <property name="shadow_type">in</property>
                                 <child>
@@ -601,7 +601,7 @@
                           <object class="GtkScrolledWindow" id="scrolledwindow2">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="hscrollbar_policy">never</property>
+                            <property name="hscrollbar_policy">automatic</property>
                             <property name="vscrollbar_policy">automatic</property>
                             <property name="shadow_type">in</property>
                             <child>
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index ef055dc..33bb7a5 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -95,6 +95,8 @@ typedef enum {
 
 static void gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection, gpointer userdata);
 
+#define GCM_PREFS_TREEVIEW_WIDTH	350 /* px */
+
 /**
  * gcm_prefs_error_dialog:
  **/
@@ -1005,12 +1007,14 @@ gcm_prefs_add_devices_columns (GtkTreeView *treeview)
 							   "icon-name", GCM_DEVICES_COLUMN_ICON, NULL);
 	gtk_tree_view_append_column (treeview, column);
 
+	/* set minimum width */
+	gtk_widget_set_size_request (GTK_WIDGET (treeview), GCM_PREFS_TREEVIEW_WIDTH, -1);
+
 	/* column for text */
 	renderer = gtk_cell_renderer_text_new ();
 	g_object_set (renderer,
-		      "ellipsize", PANGO_ELLIPSIZE_END,
-		      "wrap-mode", PANGO_WRAP_WORD_CHAR,
-		      "width-chars", 40,
+		      "wrap-mode", PANGO_WRAP_WORD,
+		      "wrap-width", GCM_PREFS_TREEVIEW_WIDTH - 62,
 		      NULL);
 	column = gtk_tree_view_column_new_with_attributes ("", renderer,
 							   "markup", GCM_DEVICES_COLUMN_TITLE, NULL);
@@ -1036,12 +1040,14 @@ gcm_prefs_add_profiles_columns (GtkTreeView *treeview)
 							   "icon-name", GCM_PROFILES_COLUMN_ICON, NULL);
 	gtk_tree_view_append_column (treeview, column);
 
+	/* set minimum width */
+	gtk_widget_set_size_request (GTK_WIDGET (treeview), GCM_PREFS_TREEVIEW_WIDTH, -1);
+
 	/* column for text */
 	renderer = gtk_cell_renderer_text_new ();
 	g_object_set (renderer,
-		      "ellipsize", PANGO_ELLIPSIZE_END,
-		      "wrap-mode", PANGO_WRAP_WORD_CHAR,
-		      "width-chars", 50,
+		      "wrap-mode", PANGO_WRAP_WORD,
+		      "wrap-width", GCM_PREFS_TREEVIEW_WIDTH - 62,
 		      NULL);
 	column = gtk_tree_view_column_new_with_attributes ("", renderer,
 							   "markup", GCM_PROFILES_COLUMN_TITLE, NULL);



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