[brasero] Hide the combo box in the side pane if there is just one item (this hides the close button as well)



commit 7233872b43cca11ef9cc8ea73fb26c8f238b5b94
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon Jun 1 11:17:08 2009 +0200

    Hide the combo box in the side pane if there is just one item (this hides the close button as well)
---
 src/brasero-layout.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/brasero-layout.c b/src/brasero-layout.c
index 271ac1d..64b71ea 100644
--- a/src/brasero-layout.c
+++ b/src/brasero-layout.c
@@ -81,6 +81,8 @@ struct BraseroLayoutPrivate {
 	GtkWidget *project;
 
 	GtkWidget *combo;
+	GtkWidget *top_box;
+
 	BraseroLayoutType ctx_type;
 	BraseroLayoutItem *active_item;
 
@@ -750,6 +752,9 @@ brasero_layout_add_source (BraseroLayout *layout,
 			    ITEM_COL, item,
 			    VISIBLE_COL, TRUE,
 			    -1);
+
+	if (gtk_tree_model_iter_n_children (model, NULL) > 1)
+		gtk_widget_show (layout->priv->top_box);
 }
 
 /**************************** empty view callback ******************************/
@@ -1424,9 +1429,9 @@ brasero_layout_init (BraseroLayout *obj)
 							      NULL,
 							      NULL);
 
-	/* close button and  combo */
+	/* close button and combo. Don't show it now. */
 	box = gtk_hbox_new (FALSE, 6);
-	gtk_widget_show (box);
+	obj->priv->top_box = box;
 	gtk_box_pack_start (GTK_BOX (obj->priv->main_box),
 			    box,
 			    FALSE,



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