[glade/modern-ui: 24/34] GladeAdaptorChooser: show group title in chooser with more than one



commit a5d0cb2bd210129fd27dd15ef4e11d2db2d52d46
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Mon Jun 26 23:17:43 2017 -0300

    GladeAdaptorChooser: show group title in chooser with more than one

 gladeui/glade-adaptor-chooser.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gladeui/glade-adaptor-chooser.c b/gladeui/glade-adaptor-chooser.c
index 68b47ea..388bbe7 100644
--- a/gladeui/glade-adaptor-chooser.c
+++ b/gladeui/glade-adaptor-chooser.c
@@ -152,10 +152,13 @@ glade_adaptor_chooser_button_add_chooser (GtkWidget *button, GtkWidget *chooser)
 }
 
 static GtkWidget *
-glade_adaptor_chooser_add_chooser (GladeAdaptorChooser *chooser)
+glade_adaptor_chooser_add_chooser (GladeAdaptorChooser *chooser,
+                                   gboolean             show_group_title)
 {
   GladeAdaptorChooserPrivate *priv = GET_PRIVATE (chooser);
-  GtkWidget *chooser_widget = _glade_adaptor_chooser_widget_new (0, NULL);
+  GtkWidget *chooser_widget = g_object_new (GLADE_TYPE_ADAPTOR_CHOOSER_WIDGET,
+                                            "show-group-title", show_group_title,
+                                            NULL);
 
   priv->choosers = g_list_prepend (priv->choosers, chooser_widget);
   g_signal_connect (chooser_widget, "adaptor-selected",
@@ -187,7 +190,7 @@ button_box_populate_from_catalog (GladeAdaptorChooser *chooser,
         {
           GtkWidget *button, *chooser_widget;
           
-          chooser_widget = glade_adaptor_chooser_add_chooser (chooser);
+          chooser_widget = glade_adaptor_chooser_add_chooser (chooser, FALSE);
           button = gtk_menu_button_new ();
           gtk_button_set_label (GTK_BUTTON (button), glade_widget_group_get_title (group));
           glade_adaptor_chooser_button_add_chooser (button, chooser_widget);
@@ -199,7 +202,7 @@ button_box_populate_from_catalog (GladeAdaptorChooser *chooser,
         {
           if (!extra_chooser)
             {
-              extra_chooser = glade_adaptor_chooser_add_chooser (chooser);
+              extra_chooser = glade_adaptor_chooser_add_chooser (chooser, TRUE);
               glade_adaptor_chooser_button_add_chooser (priv->extra_button, extra_chooser);
               gtk_widget_show (priv->extra_button);
             }
@@ -222,8 +225,8 @@ glade_adaptor_chooser_constructed (GObject *object)
   gtk_catalog = glade_app_get_catalog ("gtk+");
   button_box_populate_from_catalog (chooser, gtk_catalog);
 
-  others_chooser = glade_adaptor_chooser_add_chooser (chooser);
-  all_chooser = glade_adaptor_chooser_add_chooser (chooser);
+  others_chooser = glade_adaptor_chooser_add_chooser (chooser, TRUE);
+  all_chooser = glade_adaptor_chooser_add_chooser (chooser, TRUE);
   glade_adaptor_chooser_button_add_chooser (priv->others_button, others_chooser);
   glade_adaptor_chooser_button_add_chooser (priv->all_button, all_chooser);
 


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