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.
This commit is contained in:
Ell
2017-11-30 02:44:12 -05:00
parent d3e527a959
commit c8b4c0686c

View File

@ -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