sound: Don't allow long profile names to resize toplevel

When profile names were overly long, the whole panel was wider than
before. This allows us to clip the combobox when not popped up, but
show the full text when it is, thus avoiding problems with some
profile names looking the same because of the missing end.

https://bugzilla.gnome.org/show_bug.cgi?id=613040
This commit is contained in:
Bastien Nocera 2010-11-16 18:02:25 +00:00
parent 368f348079
commit f052f0ad16

View file

@ -302,7 +302,6 @@ gvc_combo_box_init (GvcComboBox *combo_box)
GtkWidget *ebox;
GtkCellRenderer *renderer;
combo_box->priv = GVC_COMBO_BOX_GET_PRIVATE (combo_box);
combo_box->priv->model = GTK_TREE_MODEL (gtk_list_store_new (NUM_COLS,
@ -323,12 +322,15 @@ gvc_combo_box_init (GvcComboBox *combo_box)
combo_box->priv->combobox = gtk_combo_box_new_with_model (combo_box->priv->model);
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box->priv->combobox),
renderer, FALSE);
renderer, TRUE);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo_box->priv->combobox),
renderer,
"text", COL_HUMAN_NAME);
/* gtk_widget_set_size_request (combo_box->priv->combobox, 128, -1); */
/* Make sure that the combo box isn't too wide when human names are overly long,
* but that we can still read the full length of it */
g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
g_object_set (G_OBJECT (combo_box->priv->combobox), "popup-fixed-width", FALSE, NULL);
combo_box->priv->start_box = sbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (box), sbox, FALSE, FALSE, 0);