[gnome-control-center] sound: Don't allow long profile names to resize toplevel
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sound: Don't allow long profile names to resize toplevel
- Date: Tue, 16 Nov 2010 18:04:58 +0000 (UTC)
commit f052f0ad168d853a613cca6a556b4713b67eb03a
Author: Bastien Nocera <hadess hadess net>
Date: Tue Nov 16 18:02:25 2010 +0000
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
panels/sound/gvc-combo-box.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/sound/gvc-combo-box.c b/panels/sound/gvc-combo-box.c
index 7e14fb2..5a19a44 100644
--- a/panels/sound/gvc-combo-box.c
+++ b/panels/sound/gvc-combo-box.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]