[gimp] app: use ICON_ONLY layout for group combo in GimpLayerModeBox



commit c8b4c0686c1d523b87921f3a061a6a47f8e9c00c
Author: Ell <ell_se yahoo com>
Date:   Thu Nov 30 02:44:12 2017 -0500

    app: use ICON_ONLY layout for group combo in GimpLayerModeBox
    
    Use gimp_int_combo_box_set_layout() to set the mode-group combo box
    layout to ICON_ONLY, instead of manually constructing an icon-only
    cell-layout.

 app/widgets/gimplayermodebox.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/app/widgets/gimplayermodebox.c b/app/widgets/gimplayermodebox.c
index a467632..a0395df 100644
--- a/app/widgets/gimplayermodebox.c
+++ b/app/widgets/gimplayermodebox.c
@@ -127,8 +127,6 @@ gimp_layer_mode_box_constructed (GObject *object)
   GtkWidget        *mode_combo;
   GtkWidget        *group_combo;
   GtkTreeModel     *group_model;
-  GtkCellLayout    *layout;
-  GtkCellRenderer  *cell;
   gint              i;
 
   G_OBJECT_CLASS (parent_class)->constructed (object);
@@ -151,6 +149,8 @@ gimp_layer_mode_box_constructed (GObject *object)
   box->priv->group_combo = group_combo =
     gimp_prop_enum_combo_box_new (G_OBJECT (mode_combo),
                                   "group", 0, 0);
+  gimp_int_combo_box_set_layout (GIMP_INT_COMBO_BOX (group_combo),
+                                 GIMP_INT_COMBO_BOX_LAYOUT_ICON_ONLY);
   gtk_box_pack_start (GTK_BOX (box), group_combo, FALSE, FALSE, 0);
   gtk_widget_show (group_combo);
 
@@ -158,9 +158,6 @@ gimp_layer_mode_box_constructed (GObject *object)
                            _("Switch to another group of modes"),
                            NULL);
 
-  layout = GTK_CELL_LAYOUT (gtk_bin_get_child (GTK_BIN (group_combo)));
-  gtk_cell_layout_clear (layout);
-
   group_model = gtk_combo_box_get_model (GTK_COMBO_BOX (group_combo));
 
   for (i = 0; i < 2; i++)
@@ -178,12 +175,6 @@ gimp_layer_mode_box_constructed (GObject *object)
                             GIMP_INT_STORE_ICON_NAME, icons[i],
                             -1);
     }
-
-  cell = gtk_cell_renderer_pixbuf_new ();
-  gtk_cell_layout_pack_start (layout, cell, FALSE);
-  gtk_cell_layout_set_attributes (layout, cell,
-                                  "icon-name", GIMP_INT_STORE_ICON_NAME,
-                                  NULL);
 }
 
 static void


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